Ejemplo n.º 1
0
 def test_make_github_project_fail(self):
     repo_json = {
         "name": "",
         "full_name": "",
         "description": "",
         "git_url": "",
         "private": True,
         "ssh_url": "",
         "html_url": "",
     }
     github_project = make_github_project(user=self.user, org=self.org, privacy=self.privacy, repo_json=repo_json)
     self.assertIsNone(github_project)
Ejemplo n.º 2
0
 def test_make_github_project_pass(self):
     repo_json = {
         "name": "",
         "full_name": "",
         "description": "",
         "git_url": "",
         "private": False,
         "ssh_url": "",
         "html_url": "",
     }
     github_project = make_github_project(user=self.user, org=self.org, privacy=self.privacy, repo_json=repo_json)
     self.assertIsInstance(github_project, GithubProject)
Ejemplo n.º 3
0
    def test_multiple_users_same_repo(self):
        repo_json = {
            "name": "",
            "full_name": "testrepo/multiple",
            "description": "",
            "git_url": "",
            "private": False,
            "ssh_url": "",
            "html_url": "",
        }
        github_project = make_github_project(user=self.user, org=self.org, privacy=self.privacy, repo_json=repo_json)
        github_project_2 = make_github_project(user=User.objects.get(pk=2), org=self.org, privacy=self.privacy, repo_json=repo_json)
        self.assertIsInstance(github_project, GithubProject)
        self.assertIsInstance(github_project_2, GithubProject)
        self.assertNotEqual(github_project_2, github_project)

        github_project_3 = make_github_project(user=self.user, org=self.org, privacy=self.privacy, repo_json=repo_json)
        github_project_4 = make_github_project(user=User.objects.get(pk=2), org=self.org, privacy=self.privacy, repo_json=repo_json)
        self.assertIsInstance(github_project_3, GithubProject)
        self.assertIsInstance(github_project_4, GithubProject)
        self.assertEqual(github_project, github_project_3)
        self.assertEqual(github_project_2, github_project_4)

        github_project_5 = make_github_project(user=self.user, org=self.org, privacy=self.privacy, repo_json=repo_json)
        github_project_6 = make_github_project(user=User.objects.get(pk=2), org=self.org, privacy=self.privacy, repo_json=repo_json)

        self.assertEqual(github_project, github_project_5)
        self.assertEqual(github_project_2, github_project_6)