Add some additional test cases for types.
@@ -8,20 +8,23 @@ from libcloud.compute.types import Provider, NodeState, StorageVolumeState, \
class TestType(Type):
INUSE = "inuse"
+ NOTINUSE = "NOTINUSE"
class TestTestType(TestCase):
model = TestType
- attribute = TestType.INUSE
def test_provider_tostring(self):
self.assertEqual(Provider.tostring(TestType.INUSE), "INUSE")
+ self.assertEqual(Provider.tostring(TestType.NOTINUSE), "NOTINUSE")
def test_provider_fromstring(self):
self.assertEqual(TestType.fromstring("inuse"), TestType.INUSE)
+ self.assertEqual(TestType.fromstring("NOTINUSE"), TestType.NOTINUSE)
def test_provider_fromstring_caseinsensitive(self):
self.assertEqual(TestType.fromstring("INUSE"), TestType.INUSE)
+ self.assertEqual(TestType.fromstring("notinuse"), TestType.NOTINUSE)
def test_compare_as_string(self):
self.assertTrue(TestType.INUSE == 'inuse')
