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)
def test_action_absence(self): """Error if there is no cation""" self.assertEqual( analyzer({ TIME: '1.1', USER: { ACCOUNT_NAME: 'Anonymous' } }), self.error_dictionary)
def test_correct_request(self): """Correct request""" self.assertEqual( analyzer({ ACTION: PRESENCE, TIME: 1.1, USER: { ACCOUNT_NAME: 'Anonymous' } }), self.success_dictionary)
def test_incorrect_user(self): """Error - not Anonymous""" self.assertEqual( analyzer({ ACTION: PRESENCE, TIME: 1.1, USER: { ACCOUNT_NAME: 'Anonymous1' } }), self.error_dictionary)
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)
def test_user_not_defined(self): """Error - user wasn't set""" self.assertEqual(analyzer({ ACTION: PRESENCE, TIME: '1.1' }), self.error_dictionary)