mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-05 18:50:09 +02:00
Add unit test for string_is_integer()
This commit is contained in:
parent
0e071a689d
commit
bbee2cf707
@ -1076,6 +1076,14 @@ class CommonTest(unittest.TestCase):
|
||||
with gzip.open(expected_log_path, 'r') as f:
|
||||
self.assertEqual(f.read(), mocklogcontent)
|
||||
|
||||
def test_string_is_integer(self):
|
||||
self.assertTrue(fdroidserver.common.string_is_integer('0x10'))
|
||||
self.assertTrue(fdroidserver.common.string_is_integer('010'))
|
||||
self.assertTrue(fdroidserver.common.string_is_integer('123'))
|
||||
self.assertFalse(fdroidserver.common.string_is_integer('0xgg'))
|
||||
self.assertFalse(fdroidserver.common.string_is_integer('01g'))
|
||||
self.assertFalse(fdroidserver.common.string_is_integer('o123'))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.chdir(os.path.dirname(__file__))
|
||||
|
Loading…
Reference in New Issue
Block a user