mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
python: tests: move the 'int' type in tests_helper
This way it can be used in other tests as well. Simple code motion.
This commit is contained in:
@@ -19,11 +19,7 @@ import unittest
|
||||
import sys
|
||||
import os
|
||||
import guestfs
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
cl = int
|
||||
else:
|
||||
cl = long
|
||||
from .tests_helper import *
|
||||
|
||||
class Test080Version (unittest.TestCase):
|
||||
def setUp (self):
|
||||
@@ -34,10 +30,10 @@ class Test080Version (unittest.TestCase):
|
||||
self.assertEqual (self.version['major'], 1)
|
||||
|
||||
def test_minor (self):
|
||||
self.assertIsInstance (self.version['minor'], cl)
|
||||
self.assertIsInstance (self.version['minor'], int_type)
|
||||
|
||||
def test_release (self):
|
||||
self.assertIsInstance (self.version['release'], cl)
|
||||
self.assertIsInstance (self.version['release'], int_type)
|
||||
|
||||
def test_extra (self):
|
||||
self.assertIsInstance (self.version['extra'], str)
|
||||
|
||||
@@ -17,9 +17,16 @@
|
||||
|
||||
# Utilities for the tests of the Python bindings.
|
||||
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
int_type = int
|
||||
else:
|
||||
int_type = long
|
||||
|
||||
|
||||
def skipUnlessLibirtHasCPointer ():
|
||||
"""
|
||||
Skip the current class/method if:
|
||||
|
||||
Reference in New Issue
Block a user