Exemplo n.º 1
0
 def test_no_user(self):
     """No user error"""
     self.assertEqual(
         handling_mess_from_client({
             ACTION: PRESENCE,
             TIME: '1.1'
         }), self.err_dict)
Exemplo n.º 2
0
 def test_not_matching_user(self):
     self.assertEqual(
         handling_mess_from_client({
             ACTION: PRESENCE,
             TIME: 1.1,
             USER: {
                 ACCOUNT_NAME: 'Guest1'
             }
         }), self.err_dict)
Exemplo n.º 3
0
 def test_missing_time(self):
     """error if request has no time argument"""
     self.assertEqual(
         handling_mess_from_client({
             ACTION: PRESENCE,
             USER: {
                 ACCOUNT_NAME: 'Guest'
             }
         }), self.err_dict)
Exemplo n.º 4
0
 def test_if_nothing(self):
     """error if there is no action"""
     self.assertEqual(
         handling_mess_from_client({
             TIME: '1.1',
             USER: {
                 ACCOUNT_NAME: 'Guest'
             }
         }), self.err_dict)
Exemplo n.º 5
0
 def test_good_request(self):
     """good request"""
     self.assertEqual(
         handling_mess_from_client({
             ACTION: PRESENCE,
             TIME: 1.1,
             USER: {
                 ACCOUNT_NAME: 'Guest'
             }
         }), self.good_dict)
Exemplo n.º 6
0
 def test_unknown_action(self):
     """error if unknown action"""
     self.assertEqual(
         handling_mess_from_client({
             ACTION: 'Wrong',
             TIME: '1.1',
             USER: {
                 ACCOUNT_NAME: 'Guest'
             }
         }), self.err_dict)