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:
Pino Toscano
2016-02-22 16:57:57 +01:00
parent 9776615301
commit 519c9bc8df
2 changed files with 10 additions and 7 deletions

View File

@@ -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)

View File

@@ -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: