Esempio n. 1
0
  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)
Esempio n. 2
0
  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)
Esempio n. 3
0
 def testIsEmptyClientActive(self):
   emptyClient = Client("testclient")
   self.assertFalse(emptyClient.isActive(datetime.now()))
Esempio n. 4
0
 def testIsEmptyClientActive(self):
   emptyClient = Client("testclient")
   self.assertFalse(emptyClient.isActive(datetime.now()))