Commits

Anonymous committed 43574f4

Test whether the license key can be setup from the environment.

  • Participants
  • Parent commits a236b34

Comments (0)

Files changed (2)

File tests/exception-test.py

 	def testOptionPut(self):
 		self.assertRaises( ecs.BadOption, ecs.setOptions, {'foo': 3} )
 
-
 	def testExactParameterRequirement(self):
 		pass
 

File tests/licensekey-test.py

 
 class LicenseKeyTest( unittest.TestCase ):
 
-    def testGetLicenseKey(self):
-        self.assertRaises( ecs.NoLicenseKey, ecs.getLicenseKey )
+	def testGetLicenseKey(self):
+		self.assertRaises( ecs.NoLicenseKey, ecs.getLicenseKey )
 
-    def testSetLicenseKey(self):
-        self.assertRaises( ecs.NoLicenseKey, ecs.setLicenseKey )
+	def testSetLicenseKey(self):
+		self.assertRaises( ecs.NoLicenseKey, ecs.setLicenseKey )
+
+	def testSetLicenseKeyFromEnv(self):
+		import os
+		os.environ['AWS_LICENSE_KEY'] = "FAKE-KEY"
+		self.assertEqual( ecs.getLicenseKey(), "FAKE-KEY" )
+
+class LicenseTestSuite(unittest.TestSuite):
+	# Add suite here since order matters 
+	def __init__(self):
+		unittest.TestSuite.__init__(self, map(LicenseKeyTest, 
+			('testGetLicenseKey', 'testSetLicenseKey', 'testSetLicenseKeyFromEnv')))
+
 
 if __name__ == "__main__" :
-    unittest.main()
+	unittest.main()