def testUpdateClient(self): client = Client("testclient") self.updateWithTestSettings(client, "emission/tests/coreTests/wrapperTests/testclient/testclient_settings_update.json") self.assertEqual(client.startDatetime, datetime(2015, 01, 13)) self.assertEqual(client.endDatetime, datetime(2015, 04, 25)) self.assertEqual(client.getDates()[0], datetime(2015, 01, 13)) self.assertEqual(client.getDates()[1], datetime(2015, 04, 25))
def testCreateClient(self): client = Client("testclient") client.update(createKey = False) self.assertEqual(client.startDatetime, datetime(2014, 10, 13)) self.assertEqual(client.endDatetime, datetime(2016, 12, 25)) self.assertEqual(client.isActive(datetime(2014, 11, 7)), True) self.assertEqual(client.getDates()[0], datetime(2014, 10, 13)) self.assertEqual(client.getDates()[1], datetime(2016, 12, 25)) # Reset the times in the client so that it will show as active and we will # get a valid set of settings common.makeValid(client) self.assertEqual(client.isActive(datetime.now()), True) self.assertNotEqual(client.getSettings(), None) self.assertNotEqual(client.getSettings(), {}) print client.getSettings() self.assertNotEqual(client.getSettings()['result_url'], None)