def test_host(self): ct = get_asset_type_from_string('host') self.assertEqual(ct, AssetType.HOST)
def test_none_or_empty(self): ct = get_asset_type_from_string(None) self.assertIsNone(ct) ct = get_asset_type_from_string('') self.assertIsNone(ct)
def test_os(self): ct = get_asset_type_from_string('os') self.assertEqual(ct, AssetType.OPERATING_SYSTEM) ct = get_asset_type_from_string('operating_system') self.assertEqual(ct, AssetType.OPERATING_SYSTEM)
def test_invalid(self): with self.assertRaises(InvalidArgument): get_asset_type_from_string('foo')