Skip to content

Commit

Permalink
update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amaltaro committed Aug 17, 2023
1 parent 8e5afdb commit bf644b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
12 changes: 1 addition & 11 deletions test/python/Utils_t/Utilities_t.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from Utils.Utilities import makeList, makeNonEmptyList, strToBool, \
safeStr, rootUrlJoin, zipEncodeStr, lowerCmsHeaders, getSize, \
encodeUnicodeToBytes, diskUse, numberCouchProcess, orderVersionList
encodeUnicodeToBytes, diskUse, numberCouchProcess


class UtilitiesTests(unittest.TestCase):
Expand Down Expand Up @@ -180,16 +180,6 @@ def testNumberCouchProcess(self):
# there should be at least one process, but who knows...
self.assertTrue(data >= 0)

def testOrderVersionList(self):
"""
Test the `orderVersionList` function.
"""
oldL = ["2.3.1", "1.2.3", "3.2.1", "1.3.2", "1.2"]
newL = ["1.2", "1.2.3", "1.3.2", "2.3.1", "3.2.1"]
with self.assertRaises(AssertionError):
self.assertListEqual(oldL, newL)
self.assertListEqual(orderVersionList(oldL), newL)


if __name__ == '__main__':
unittest.main()
7 changes: 4 additions & 3 deletions test/python/WMCore_t/BossAir_t/BasePlugin_t.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ def testCudaCapabilityToSingleVersion(self):
bp = BasePlugin(config=None)

# bad input
self.assertEqual(bp.cudaCapabilityToSingleVersion([]), 0)
self.assertEqual(bp.cudaCapabilityToSingleVersion({}), 0)
self.assertEqual(bp.cudaCapabilityToSingleVersion(None), 0)
self.assertEqual(bp.cudaCapabilityToSingleVersion([]), None)
self.assertEqual(bp.cudaCapabilityToSingleVersion({}), None)
self.assertEqual(bp.cudaCapabilityToSingleVersion(None), None)
# good and expected input
self.assertEqual(bp.cudaCapabilityToSingleVersion(["5.0"]), 5000)
unorderedL = ["2.3.1", "1.2.3", "3.2.1", "1.3.2", "1.2"]
self.assertEqual(bp.cudaCapabilityToSingleVersion(unorderedL), 1020)
orderedL = ["1.2", "1.2.3", "1.3.2", "2.3.1", "3.2.1"]
Expand Down

0 comments on commit bf644b7

Please sign in to comment.