Esempio n. 1
0
 def test_time_not_defined(self):
     """Error if request has no stamp of time"""
     self.assertEqual(
         analyzer({
             ACTION: PRESENCE,
             USER: {
                 ACCOUNT_NAME: 'Anonymous'
             }
         }), self.error_dictionary)
Esempio n. 2
0
 def test_action_absence(self):
     """Error if there is no cation"""
     self.assertEqual(
         analyzer({
             TIME: '1.1',
             USER: {
                 ACCOUNT_NAME: 'Anonymous'
             }
         }), self.error_dictionary)
Esempio n. 3
0
 def test_correct_request(self):
     """Correct request"""
     self.assertEqual(
         analyzer({
             ACTION: PRESENCE,
             TIME: 1.1,
             USER: {
                 ACCOUNT_NAME: 'Anonymous'
             }
         }), self.success_dictionary)
Esempio n. 4
0
 def test_incorrect_user(self):
     """Error - not Anonymous"""
     self.assertEqual(
         analyzer({
             ACTION: PRESENCE,
             TIME: 1.1,
             USER: {
                 ACCOUNT_NAME: 'Anonymous1'
             }
         }), self.error_dictionary)
Esempio n. 5
0
 def test_wrong_action(self):
     """Error if action wasn't defined"""
     self.assertEqual(
         analyzer({
             ACTION: 'Wrong',
             TIME: '1.1',
             USER: {
                 ACCOUNT_NAME: 'Anonymous'
             }
         }), self.error_dictionary)
Esempio n. 6
0
 def test_user_not_defined(self):
     """Error - user wasn't set"""
     self.assertEqual(analyzer({
         ACTION: PRESENCE,
         TIME: '1.1'
     }), self.error_dictionary)