-
-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathtest_github.py
More file actions
52 lines (46 loc) · 1.78 KB
/
test_github.py
File metadata and controls
52 lines (46 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# purldb is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/purldb for support or download.
# See https://aboutcode.org for more information about nexB OSS projects.
#
import os
from django.test import TestCase as DjangoTestCase
from minecode.collectors import github
from minecode.utils_test import JsonBasedTesting
class GithubPriorityQueueTests(JsonBasedTesting, DjangoTestCase):
test_data_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), "testfiles")
def test_github_get_all_versions(self):
repo_path = "aboutcode-org/purldb"
versions = github.github_get_all_versions(repo_path)
expected = [
"v7.0.0",
"v6.0.0",
"v5.0.1",
"v5.0.0",
"v3.0.0",
"v2.0.0",
"purldb-toolkit-v0.1.0",
"purl2vcs-v2.0.0",
"purl2vcs-v1.0.2",
"pre-scan-queue-update",
"matchcode-toolkit-v3.0.0",
"matchcode-toolkit-v1.1.1",
"minecode-pipelines/v0.0.1b3",
"minecode-pipelines/v0.0.1b4",
"minecode-pipelines/v0.0.1b5",
"minecode-pipelines/v0.0.1b6",
"minecode-pipelines/v0.0.1b7",
"minecode-pipelines/v0.0.1b8",
"minecode-pipelines/v0.0.1b9",
"minecode-pipelines/v0.0.1b10",
"minecode-pipelines/v0.0.1b11",
"minecode-pipelines/v0.0.1b12",
"minecode-pipelines/v0.0.1b13",
"minecode-pipelines/v0.0.1b14",
"minecode-pipelines/v0.0.1b15",
]
for item in expected:
self.assertIn(item, versions)