예제 #1
0
 def test_get_return_200_if_not_team_owner(self):
     self._add_results_for_last()
     user = UserFactory.create(with_token=True)
     TeamFactory.create(owner=user)
     url = "/load-test-result/%s/last/" % self.load_test2.results[1].uuid
     response = self.fetch_with_headers(url)
     expect(response.code).to_equal(200)
예제 #2
0
 def test_get_return_200_if_not_team_owner(self):
     self._add_results()
     user = UserFactory.create(with_token=True)
     TeamFactory.create(owner=user)
     url = "/results/%s/%s/%s/%s/%s" % (self.team.name, self.project.name, self.config.module, self.config.class_name, self.config.test_name)
     response = self.fetch_with_headers(url)
     expect(response.code).to_equal(200)
예제 #3
0
 def test_get_return_200_if_not_team_owner(self):
     self._add_results_for_last()
     user = UserFactory.create(with_token=True)
     TeamFactory.create(owner=user)
     url = "/load-test-result/%s/last/" % self.load_test2.results[1].uuid
     response = self.fetch_with_headers(url)
     expect(response.code).to_equal(200)
예제 #4
0
 def test_get_return_200_if_not_team_owner(self):
     self._add_results()
     user = UserFactory.create(with_token=True)
     TeamFactory.create(owner=user)
     url = "/results/%s/%s/%s/%s/%s" % (
         self.team.name, self.project.name, self.config.module,
         self.config.class_name, self.config.test_name)
     response = self.fetch_with_headers(url)
     expect(response.code).to_equal(200)
예제 #5
0
    def test_show_memberships(self):
        t1 = TeamFactory.create(owner=self.user)
        t2 = TeamFactory.create(members=[self.user])
        result = self.execute("user-info")

        expected = ("""User: %s
          +--------+--------+
          | team   | role   |
          +--------+--------+
          | %s     | owner  |
          | %s     | member |
          +--------+--------+
        """ % (self.user.email, t1.name, t2.name)).replace('-', '')

        expect(result.replace('-', '')).to_be_like(expected)
예제 #6
0
    def test_show_memberships(self):
        t1 = TeamFactory.create(owner=self.user)
        t2 = TeamFactory.create(members=[self.user])
        result = self.execute("user-info")

        expected = ("""User: %s
          +--------+--------+
          | team   | role   |
          +--------+--------+
          | %s     | owner  |
          | %s     | member |
          +--------+--------+
        """ % (self.user.email, t1.name, t2.name)).replace('-', '')

        expect(result.replace('-', '')).to_be_like(expected)
예제 #7
0
 def test_try_delete_team_without_auth(self):
     team = TeamFactory.create(owner=self.user)
     self.user = None
     response = self.delete("/teams/anything")
     expect(response.code).to_equal(401)
     team = Team.objects.filter(name=team.name).first()
     expect(team).not_to_be_null()
예제 #8
0
    def test_schedule_test_without_being_a_member(self):
        team = TeamFactory.create()
        prj = team.add_project("bla", "repo", team.owner)

        url = "/teams/%s/projects/%s/load_tests/" % (team.name, prj.name)
        response = self.post(url, **{"base_url": "http://www.globo.com"})
        expect(response.code).to_equal(403)
예제 #9
0
    def test_add_team_member_twice(self):
        user = UserFactory.create()
        team = TeamFactory.create(owner=self.user, members=[user])

        response = self.patch("/teams/%s/members" % team.name, user=user.email)
        expect(response.code).to_equal(409)
        expect(response.body).to_equal("User already team member")
예제 #10
0
    def test_add_owner_as_a_member(self):
        team = TeamFactory.create(owner=self.user)

        response = self.patch("/teams/%s/members" % team.name,
                              user=self.user.email)
        expect(response.code).to_equal(409)
        expect(response.body).to_equal("User already team owner")
예제 #11
0
    def setUp(self):
        super(ScheduleLoadTestTest, self).setUp()

        self.user = UserFactory.create(with_token=True)
        self.team = TeamFactory.create(owner=self.user)
        self.project = self.team.add_project("schedule-test-project-1", "repo",
                                             self.user)
예제 #12
0
    def test_can_run_simple_project(self):
        temp_path = mkdtemp()
        team = TeamFactory.create()
        TeamFactory.add_projects(team, 1)
        user = team.owner
        project = team.projects[0]
        load_test = LoadTestFactory.add_to_project(1,
                                                   user=user,
                                                   team=team,
                                                   project=project,
                                                   base_url="%s/healthcheck" %
                                                   self.base_url,
                                                   simple=True)

        runner = BenchRunner()
        runner.run_project_tests(temp_path, str(load_test.uuid), duration=1)

        loaded = LoadTest.objects(uuid=load_test.uuid).first()

        expect(loaded).not_to_be_null()
        expect(loaded.status).to_equal("Finished")

        expect(loaded.results).to_length(1)

        expect(loaded.results[0].log).not_to_be_null()
        expect(loaded.results[0].status).to_equal("Successful")
        expect(loaded.results[0].config.module).to_equal("test_simple")
        expect(loaded.results[0].config.class_name).to_equal("SimpleTestTest")
        expect(loaded.results[0].config.test_name).to_equal("test_simple")
예제 #13
0
 def test_delete_a_project(self):
     team = TeamFactory.create()
     TeamFactory.add_projects(team, 1)
     project = team.projects[0]
     team.delete_project(project.name)
     retrieved = Team.objects.filter(name=team.name).first()
     expect(retrieved.projects).to_length(0)
예제 #14
0
    def test_can_run_project(self):
        temp_path = mkdtemp()

        team = TeamFactory.create(name="teste")
        TeamFactory.add_projects(team, 1)
        user = team.owner
        project = team.projects[0]
        project.repository = "git://github.com/heynemann/wight.git"
        load_test = LoadTestFactory.add_to_project(1,
                                                   user=user,
                                                   team=team,
                                                   project=project,
                                                   base_url=self.base_url)

        runner = BenchRunner()
        runner.run_project_tests(temp_path, str(load_test.uuid), duration=1)

        loaded = LoadTest.objects(uuid=load_test.uuid).first()

        expect(loaded).not_to_be_null()
        expect(loaded.status).to_equal("Finished")

        expect(loaded.results).to_length(2)

        expect(loaded.results[0].log).not_to_be_null()
        expect(loaded.results[0].status).to_equal("Successful")
예제 #15
0
    def test_load_test_instance(self):
        team = TeamFactory.create(owner=self.user)
        project = team.add_project("load-test-instace-acc-1", "repo", self.user)
        load_test = LoadTestFactory.create(created_by=team.owner, team=team, project_name=project.name)
        result1 = TestResultFactory.build()
        result2 = TestResultFactory.build()
        load_test.results.append(result1)
        load_test.results.append(result2)
        load_test.save()

        result = self.execute("show", load_test.uuid)
        expected_text = [
            result1.config.title,
            result1.cycles[-1].concurrent_users,
            result1.cycles[-1].request.successful_requests_per_second,
            result1.cycles[-1].request.p95,
            result1.cycles[-1].request.failed_requests,
            result1.uuid,

            result2.config.title,
            result2.cycles[-1].concurrent_users,
            result2.cycles[-1].request.successful_requests_per_second,
            result2.cycles[-1].request.p95,
            result2.cycles[-1].request.failed_requests,
            result2.uuid,
            load_test.uuid,
            load_test.status
        ]

        for expected in expected_text:
            expect(result).to_include(expected)
예제 #16
0
 def test_delete_a_project(self):
     team = TeamFactory.create()
     TeamFactory.add_projects(team, 1)
     project = team.projects[0]
     team.delete_project(project.name)
     retrieved = Team.objects.filter(name=team.name).first()
     expect(retrieved.projects).to_length(0)
예제 #17
0
    def test_create_project_with_same_name_in_different_teams(self):
        team = TeamFactory.create()
        team2 = TeamFactory.create()

        team.add_project(name="test-can-create-project", repository="repo", created_by=team.owner)
        team2.add_project(name="test-can-create-project", repository="repo", created_by=team2.owner)

        retrieved = Team.objects.filter(name=team.name).first()
        expect(retrieved).not_to_be_null()
        expect(retrieved.projects).to_length(1)
        expect(retrieved.projects[0].name).to_equal(team.projects[0].name)

        retrieved = Team.objects.filter(name=team2.name).first()
        expect(retrieved).not_to_be_null()
        expect(retrieved.projects).to_length(1)
        expect(retrieved.projects[0].name).to_equal(team2.projects[0].name)
예제 #18
0
 def test_try_delete_team_without_auth(self):
     team = TeamFactory.create(owner=self.user)
     self.user = None
     response = self.delete("/teams/anything")
     expect(response.code).to_equal(401)
     team = Team.objects.filter(name=team.name).first()
     expect(team).not_to_be_null()
예제 #19
0
    def test_add_non_existent_user(self):
        team = TeamFactory.create(owner=self.user)

        response = self.patch("/teams/%s/members" % team.name,
                              user="******")
        expect(response.code).to_equal(400)
        expect(response.body).to_equal("User not found")
예제 #20
0
    def test_add_team_member_twice(self):
        user = UserFactory.create()
        team = TeamFactory.create(owner=self.user, members=[user])

        response = self.patch("/teams/%s/members" % team.name, user=user.email)
        expect(response.code).to_equal(409)
        expect(response.body).to_equal("User already team member")
예제 #21
0
    def test_can_run_funkload(self):
        team = TeamFactory.create()
        TeamFactory.add_projects(team, 1)
        user = team.owner
        project = team.projects[0]
        load_test = LoadTestFactory.add_to_project(1, user=user, team=team, project=project)
        load_test.pressure = "small"

        conf = WightConfig.load(join(root_path, 'bench', 'wight.yml'))
        test = conf.tests[0]

        DEFAULT_CYCLES = {
            "small": [10, 20],
            "medium": [10, 20, 30],
            "large": [30, 75, 100],
        }

        fl_result = FunkLoadBenchRunner.run(root_path, test, self.base_url, cycles=DEFAULT_CYCLES, duration=5)

        expect(fl_result).not_to_be_null()
        expect(fl_result.exit_code).to_equal(0)

        expect(fl_result.text).to_include("SUCCESSFUL")

        expect(fl_result.log).to_be_empty()

        expect(fl_result.result).not_to_be_null()
        expect(fl_result.config).not_to_be_null()

        result = LoadTest.get_data_from_funkload_results(fl_result.config, fl_result.result)

        load_test.add_result(result, fl_result.text)

        expect(load_test.results).to_length(1)
예제 #22
0
    def setUp(self):
        super(DeleteTeamProjectTest, self).setUp()

        self.user = UserFactory.create(with_token=True)
        self.team = TeamFactory.create(owner=self.user)
        TeamFactory.add_projects(self.team, 1)
        TeamFactory.add_members(self.team, 2)
        self.project = self.team.projects[0]
예제 #23
0
    def test_update_team_to_empty_name(self):
        team = TeamFactory.create(owner=self.user)

        response = self.put("/teams/%s" % team.name, name="")
        expect(response.code).to_equal(400)

        response = self.put("/teams/%s" % team.name)
        expect(response.code).to_equal(400)
예제 #24
0
    def test_try_to_delete_a_not_owner_team(self):
        team = TeamFactory.create(owner=UserFactory.create(with_token=True))

        response = self.delete("/teams/%s" % team.name)
        expect(response.code).to_equal(403)

        team = Team.objects.filter(name=team.name).first()
        expect(team).not_to_be_null()
 def test_get_return_403_if_not_team_owner(self):
     user = UserFactory.create(with_token=True)
     team = TeamFactory.create(owner=user)
     url = "/teams/%s/projects/%s/load-tests/%s/results/some-result-uuid" % (
         team.name, self.project.name, self.load_test.uuid
     )
     response = self.fetch_with_headers(url)
     expect(response.code).to_equal(403)
예제 #26
0
    def test_try_to_delete_a_not_owner_team(self):
        team = TeamFactory.create(owner=UserFactory.create(with_token=True))

        response = self.delete("/teams/%s" % team.name)
        expect(response.code).to_equal(403)

        team = Team.objects.filter(name=team.name).first()
        expect(team).not_to_be_null()
예제 #27
0
    def test_can_create_empty_team(self):
        team = TeamFactory.create()

        retrieved = Team.objects(id=team.id)
        expect(retrieved.count()).to_equal(1)
        expect(retrieved.first().name).to_equal(team.name)

        expect(retrieved.first().owner.id).to_equal(team.owner.id)
예제 #28
0
    def test_update_team_to_empty_name(self):
        team = TeamFactory.create(owner=self.user)

        response = self.put("/teams/%s" % team.name, name="")
        expect(response.code).to_equal(400)

        response = self.put("/teams/%s" % team.name)
        expect(response.code).to_equal(400)
예제 #29
0
    def test_can_update_team(self):
        team = TeamFactory.create(owner=self.user)

        result = self.execute("team-update", team.name, "new-team-name")
        expect(result).to_be_like("Updated '%s' team to 'new-team-name' in '%s' target." % (team.name, self.target))

        team = Team.objects.filter(name="new-team-name").first()
        expect(team).not_to_be_null()
예제 #30
0
 def test_update_a_project_with_name(self):
     team = TeamFactory.create()
     TeamFactory.add_projects(team, 1)
     project = team.projects[0]
     team.update_project(project.name, "new-name")
     retrieved = Team.objects.filter(name=team.name).first()
     expect(retrieved.projects[0].name).to_equal("new-name")
     expect(retrieved.projects[0].repository).to_equal(project.repository)
예제 #31
0
    def setUp(self):
        super(DeleteTeamProjectTest, self).setUp()

        self.user = UserFactory.create(with_token=True)
        self.team = TeamFactory.create(owner=self.user)
        TeamFactory.add_projects(self.team, 1)
        TeamFactory.add_members(self.team, 2)
        self.project = self.team.projects[0]
예제 #32
0
    def test_can_create_empty_team(self):
        team = TeamFactory.create()

        retrieved = Team.objects(id=team.id)
        expect(retrieved.count()).to_equal(1)
        expect(retrieved.first().name).to_equal(team.name)

        expect(retrieved.first().owner.id).to_equal(team.owner.id)
예제 #33
0
 def test_update_a_project_with_repository(self):
     team = TeamFactory.create()
     TeamFactory.add_projects(team, 1)
     project = team.projects[0]
     team.update_project(project.name, new_repository="new-repository")
     retrieved = Team.objects.filter(name=team.name).first()
     expect(retrieved.projects[0].name).to_equal(project.name)
     expect(retrieved.projects[0].repository).to_equal("new-repository")
예제 #34
0
    def test_schedule_test_without_being_a_member(self):
        team = TeamFactory.create()
        prj = team.add_project("bla", "repo", team.owner)

        url = "/teams/%s/projects/%s/load_tests/" % (team.name, prj.name)
        response = self.post(url, **{
            "base_url": "http://www.globo.com"
        })
        expect(response.code).to_equal(403)
예제 #35
0
    def test_can_add_user(self):
        team = TeamFactory.create(owner=self.user)
        user = UserFactory.create()

        result = self.execute("team-adduser", team.name, user.email)
        expect(result).to_be_like("User '%s' added to Team '%s'." % (user.email, team.name))

        team = Team.objects.filter(name=team.name).first()
        expect(team.members).to_include(user)
예제 #36
0
    def test_update_team(self):
        team = TeamFactory.create(owner=self.user)

        response = self.put("/teams/%s" % team.name, name="new-name-4")
        expect(response.code).to_equal(200)
        expect(response.body).to_equal("OK")

        team = Team.objects.filter(name='new-name-4').first()
        expect(team).not_to_be_null()
예제 #37
0
    def test_can_remove_user(self):
        user = UserFactory.create()
        team = TeamFactory.create(owner=self.user, members=[user])

        result = self.execute("team-removeuser", team.name, user.email)
        expect(result).to_be_like("User '%s' removed from Team '%s'." % (user.email, team.name))

        team = Team.objects.filter(name=team.name).first()
        expect(team.members).not_to_include(user)
예제 #38
0
    def test_delete_team(self):
        team = TeamFactory.create(owner=self.user)

        response = self.delete("/teams/%s" % team.name)
        expect(response.code).to_equal(200)
        expect(response.body).to_equal("OK")

        team = Team.objects.filter(name=team.name).first()
        expect(team).to_be_null()
예제 #39
0
    def test_update_team(self):
        team = TeamFactory.create(owner=self.user)

        response = self.put("/teams/%s" % team.name, name="new-name-4")
        expect(response.code).to_equal(200)
        expect(response.body).to_equal("OK")

        team = Team.objects.filter(name='new-name-4').first()
        expect(team).not_to_be_null()
예제 #40
0
 def test_get_last_3_load_tests_for_all_projects_when_owner(self):
     LoadTestFactory.add_to_project(4, user=self.user, team=self.team, project=self.project)
     LoadTestFactory.add_to_project(4, user=self.user, team=self.team, project=self.team.projects[1])
     team = TeamFactory.create(owner=self.user)
     TeamFactory.add_projects(team, 1)
     LoadTestFactory.add_to_project(4, user=self.user, team=team, project=team.projects[0])
     LoadTestFactory.add_to_project(4, user=UserFactory.create())
     loaded_tests = list(LoadTest.get_by_user(self.user))
     expect(loaded_tests).to_length(9)
예제 #41
0
    def test_delete_team(self):
        team = TeamFactory.create(owner=self.user)

        response = self.delete("/teams/%s" % team.name)
        expect(response.code).to_equal(200)
        expect(response.body).to_equal("OK")

        team = Team.objects.filter(name=team.name).first()
        expect(team).to_be_null()
예제 #42
0
    def test_can_create_team_with_members(self):
        team = TeamFactory.create()
        TeamFactory.add_members(team, 1)

        retrieved = Team.objects(id=team.id)
        expect(retrieved.count()).to_equal(1)
        expect(retrieved.first().name).to_equal(team.name)
        expect(retrieved.first().members).to_length(1)
        expect(retrieved.first().members[0].email).to_equal(team.members[0].email)
예제 #43
0
 def setUp(self):
     super(LoadTestsInstanceTest, self).setUp()
     self.user = UserFactory.create(with_token=True)
     self.team = TeamFactory.create(owner=self.user)
     self.project = self.team.add_project("schedule-test-project-1", "repo",
                                          self.user)
     self.load_test = LoadTestFactory.create(created_by=self.team.owner,
                                             team=self.team,
                                             project_name=self.project.name)
 def setUp(self):
     super(ShowAuthLoadTestResultTest, self).setUp()
     self.user = UserFactory.create(with_token=True)
     self.team = TeamFactory.create(owner=self.user)
     TeamFactory.add_projects(self.team, 1)
     self.project = self.team.projects[0]
     self.load_test = LoadTestFactory.create(created_by=self.user, team=self.team, project_name=self.project.name)
     self.load_test.results.append(TestResultFactory.build())
     self.load_test.save()
     self.result = self.load_test.results[0]
예제 #45
0
    def test_can_create_team_with_members(self):
        team = TeamFactory.create()
        TeamFactory.add_members(team, 1)

        retrieved = Team.objects(id=team.id)
        expect(retrieved.count()).to_equal(1)
        expect(retrieved.first().name).to_equal(team.name)
        expect(retrieved.first().members).to_length(1)
        expect(retrieved.first().members[0].email).to_equal(
            team.members[0].email)
예제 #46
0
 def setUp(self):
     super(ShowLoadLastTestResultTest, self).setUp()
     self.user = UserFactory.create(with_token=True)
     self.team = TeamFactory.create(owner=self.user)
     TeamFactory.add_projects(self.team, 1)
     self.project = self.team.projects[0]
     self.load_test = LoadTestFactory.create(created_by=self.user, team=self.team, project_name=self.project.name, status="Finished")
     self.load_test.results.append(TestResultFactory.build())
     self.load_test.save()
     self.result = self.load_test.results[0]
예제 #47
0
    def test_list_load_tests_by_user_only(self):
        team1 = TeamFactory.create(owner=self.user)
        team2 = TeamFactory.create(owner=self.user)
        TeamFactory.add_projects(team1, 2)
        TeamFactory.add_projects(team2, 3)

        project1 = team1.projects[0]
        project2 = team1.projects[1]

        project3 = team2.projects[0]
        project4 = team2.projects[1]
        project5 = team2.projects[2]

        LoadTestFactory.add_to_project(4, user=self.user, team=team1, project=project1)
        LoadTestFactory.add_to_project(4, user=self.user, team=team1, project=project2)

        LoadTestFactory.add_to_project(4, user=self.user, team=team2, project=project3)
        LoadTestFactory.add_to_project(4, user=self.user, team=team2, project=project4)
        LoadTestFactory.add_to_project(4, user=self.user, team=team2, project=project5)

        load_tests1 = LoadTest.get_sliced_by_team_and_project_name(team1, project1.name, 3)
        load_tests2 = LoadTest.get_sliced_by_team_and_project_name(team1, project2.name, 3)

        load_tests3 = LoadTest.get_sliced_by_team_and_project_name(team2, project3.name, 3)
        load_tests4 = LoadTest.get_sliced_by_team_and_project_name(team2, project4.name, 3)
        load_tests5 = LoadTest.get_sliced_by_team_and_project_name(team2, project5.name, 3)

        uuids1 = _get_print_lines_for_load_tests(load_tests1)
        uuids2 = _get_print_lines_for_load_tests(load_tests2)

        uuids3 = _get_print_lines_for_load_tests(load_tests3)
        uuids4 = _get_print_lines_for_load_tests(load_tests4)
        uuids5 = _get_print_lines_for_load_tests(load_tests5)

        result = self.execute("list")

        expect(result).to_be_like((BASE_LOAD_TESTS_TABLE_PRINT * 5) % (
            team1.name, project1.name, "".join(uuids1),
            team1.name, project2.name, "".join(uuids2),
            team2.name, project3.name, "".join(uuids3),
            team2.name, project4.name, "".join(uuids4),
            team2.name, project5.name, "".join(uuids5)
        ))
예제 #48
0
    def test_can_update_team(self):
        team = TeamFactory.create(owner=self.user)

        result = self.execute("team-update", team.name, "new-team-name")
        expect(result).to_be_like(
            "Updated '%s' team to 'new-team-name' in '%s' target." %
            (team.name, self.target))

        team = Team.objects.filter(name="new-team-name").first()
        expect(team).not_to_be_null()
예제 #49
0
 def setUp(self):
     super(ShowTestResultForTeamProjectAndTestTest, self).setUp()
     self.user = UserFactory.create(with_token=True)
     self.team = TeamFactory.create(owner=self.user)
     TeamFactory.add_projects(self.team, 2)
     self.project = self.team.projects[0]
     self.load_test = LoadTestFactory.create(created_by=self.user, team=self.team, project_name=self.project.name, status="Finished")
     self.load_test.save()
     self.config = TestConfigurationFactory.build()
     self.config2 = TestConfigurationFactory.build()
예제 #50
0
    def test_can_create_project_being_a_member(self):
        team = TeamFactory.create()
        TeamFactory.add_members(team, 2)
        team.add_project(name="test-can-create-project-being-a-member", repository="repo", created_by=team.members[0])

        retrieved = Team.objects.filter(name=team.name).first()
        expect(retrieved).not_to_be_null()
        expect(retrieved.projects).to_length(1)
        expect(retrieved.projects[0].name).to_equal(team.projects[0].name)
        expect(retrieved.projects[0].repository).to_equal(team.projects[0].repository)
예제 #51
0
    def test_can_add_user(self):
        team = TeamFactory.create(owner=self.user)
        user = UserFactory.create()

        result = self.execute("team-adduser", team.name, user.email)
        expect(result).to_be_like("User '%s' added to Team '%s'." %
                                  (user.email, team.name))

        team = Team.objects.filter(name=team.name).first()
        expect(team.members).to_include(user)
예제 #52
0
    def test_can_remove_user(self):
        user = UserFactory.create()
        team = TeamFactory.create(owner=self.user, members=[user])

        result = self.execute("team-removeuser", team.name, user.email)
        expect(result).to_be_like("User '%s' removed from Team '%s'." %
                                  (user.email, team.name))

        team = Team.objects.filter(name=team.name).first()
        expect(team.members).not_to_include(user)
예제 #53
0
    def test_created_by_invalid_user(self):
        user = UserFactory.create()
        team = TeamFactory.create()
        try:
            team.add_project(name="test-can-create-project", repository="repo", created_by=user)
        except ValidationError:
            exc = sys.exc_info()[1]
            expect(str(exc)).to_include("Only the owner or members of team %s can create projects for it." % team.name)
            return

        assert False, "Should not have gotten this far"
예제 #54
0
    def test_list_load_tests_by_team_and_project(self):
        team = TeamFactory.create(owner=self.user)
        TeamFactory.add_projects(team, 1)
        project = team.projects[0]
        LoadTestFactory.add_to_project(25, user=self.user, team=team, project=project)

        load_tests = LoadTest.get_sliced_by_team_and_project_name(team, project.name, 20)
        uuids = _get_print_lines_for_load_tests(load_tests)

        result = self.execute("list", team=team.name, project=project.name)
        expect(result).to_be_like(BASE_LOAD_TESTS_TABLE_PRINT % (team.name, project.name, "".join(uuids)))
예제 #55
0
    def test_create_project_with_same_name_in_different_teams(self):
        team = TeamFactory.create()
        team2 = TeamFactory.create()

        team.add_project(name="test-can-create-project",
                         repository="repo",
                         created_by=team.owner)
        team2.add_project(name="test-can-create-project",
                          repository="repo",
                          created_by=team2.owner)

        retrieved = Team.objects.filter(name=team.name).first()
        expect(retrieved).not_to_be_null()
        expect(retrieved.projects).to_length(1)
        expect(retrieved.projects[0].name).to_equal(team.projects[0].name)

        retrieved = Team.objects.filter(name=team2.name).first()
        expect(retrieved).not_to_be_null()
        expect(retrieved.projects).to_length(1)
        expect(retrieved.projects[0].name).to_equal(team2.projects[0].name)
예제 #56
0
    def test_remove_user_that_does_not_belong_to_team(self):
        user = UserFactory.create()
        team = TeamFactory.create(owner=self.user)

        response = self.delete("/teams/%s/members" % team.name, user=user.email)
        expect(response.code).to_equal(400)
        expect(response.body).to_equal("User not found")

        team = Team.objects.filter(name=team.name).first()
        expect(team).not_to_be_null()
        expect(team.members).to_length(0)