def test_error_post_question_fail_user(self): id = str(utils.make_uuid()) uri = "/users/%s/questions" % id rv = self.client.post(uri, data=json.dumps( {'description': 'herps and derps'}), follow_redirects=True) self.assertEqual(rv.status_code, 404)
def __init__(self, **kwargs): super(Action, self).__init__(**kwargs) self.id = unicode(utils.make_uuid())
def __init__(self, **kwargs): super(User, self).__init__(**kwargs) self.id = unicode(utils.make_uuid()) self.display_name = kwargs['username'] self.username = kwargs['username'].lower()
def test_error_get_one_user_by_fail_id(self): id = str(utils.make_uuid()) rv = self.client.get('/users/' + id) self.assertEqual(rv.status_code, 404)
def test_error_create_event_bad_user_id(self): rv = self.client.post('/events', data=json.dumps( {'name': 'test', 'owner_id': str(utils.make_uuid())} ), follow_redirects=True) self.assertEqual(rv.status_code, 404)
def test_error_get_owner_of_bad_event(self): id = str(utils.make_uuid()) rv = self.client.get('/events/%s/owner' % id, follow_redirects=True) self.assertEqual(rv.status_code, 404)
def __init__(self, **kwargs): super(DataProvider, self).__init__(**kwargs) self.id = unicode(utils.make_uuid())
def test_error_delete_fail_question(self): id = str(utils.make_uuid()) rv = self.client.delete('/questions/'+id) self.assertEqual(rv.status_code, 404)
def test_error_get_question_by_fail_user(self): id = str(utils.make_uuid()) rv = self.client.get('/users/'+id+'/questions') self.assertEqual(rv.status_code, 404)
def test_make_uuid(self): temp_uuid = utils.make_uuid() assert isinstance(temp_uuid, uuid.UUID) assert len(str(temp_uuid)) == 36
def test_uuid_check_valid(self): uuids = set([utils.make_uuid() for i in range(100)]) for uuid in uuids: assert utils.is_uuid(uuid)
def test_make_uuid_uniqueness(self): uuids = set([utils.make_uuid() for i in range(100)]) assert len(uuids) == 100
def test_error_delete_fail_event(self): id = str(utils.make_uuid()) rv = self.client.delete('/events/'+id) logger.debug(rv.data) self.assertEqual(rv.status_code, 404)
def test_error_get_one_event_by_fail_id(self): id = str(utils.make_uuid()) rv = self.client.get('/events/'+id) logger.debug(rv.data) self.assertEqual(rv.status_code, 404)