Give repo generation tool clearer name
This commit is contained in:
@@ -5,7 +5,7 @@ from pathlib import Path
|
|||||||
import logging
|
import logging
|
||||||
import ast
|
import ast
|
||||||
import json
|
import json
|
||||||
import make_repo
|
import bpkg-repogen
|
||||||
|
|
||||||
logging.basicConfig(level=logging.ERROR,
|
logging.basicConfig(level=logging.ERROR,
|
||||||
format='%(levelname)8s: %(message)s')
|
format='%(levelname)8s: %(message)s')
|
||||||
@@ -18,19 +18,19 @@ class TestRepoGeneration(unittest.TestCase):
|
|||||||
def test_extract_blinfo_from_nonexistent(self):
|
def test_extract_blinfo_from_nonexistent(self):
|
||||||
test_file = 'file_that_doesnt_exist'
|
test_file = 'file_that_doesnt_exist'
|
||||||
with self.assertRaises(FileNotFoundError):
|
with self.assertRaises(FileNotFoundError):
|
||||||
make_repo.extract_blinfo(self.addon_path / test_file)
|
bpkg-repogen.extract_blinfo(self.addon_path / test_file)
|
||||||
|
|
||||||
def test_package_quantity(self):
|
def test_package_quantity(self):
|
||||||
repo = make_repo.make_repo(self.addon_path, "name of the repo")
|
repo = bpkg-repogen.bpkg-repogen(self.addon_path, "name of the repo")
|
||||||
acceptible_addons = [
|
acceptible_addons = [
|
||||||
f for f in self.addon_path.iterdir()
|
f for f in self.addon_path.iterdir()
|
||||||
if not f.match('*nonaddon*')
|
if not f.match('*nonaddon*')
|
||||||
]
|
]
|
||||||
self.assertEqual(len(repo.packages), len(acceptible_addons))
|
self.assertEqual(len(repo.packages), len(acceptible_addons))
|
||||||
|
|
||||||
def test_make_repo_from_nonexistent(self):
|
def test_bpkg-repogen_from_nonexistent(self):
|
||||||
with self.assertRaises(FileNotFoundError):
|
with self.assertRaises(FileNotFoundError):
|
||||||
make_repo.make_repo(Path('in_a_galaxy_far_far_away'), "somename")
|
bpkg-repogen.bpkg-repogen(Path('in_a_galaxy_far_far_away'), "somename")
|
||||||
|
|
||||||
# addons which should contain bl_infos
|
# addons which should contain bl_infos
|
||||||
yes_blinfo = [
|
yes_blinfo = [
|
||||||
@@ -45,7 +45,7 @@ no_blinfo = [
|
|||||||
|
|
||||||
def generate_good_blinfo_test(test_file: Path):
|
def generate_good_blinfo_test(test_file: Path):
|
||||||
def test(self):
|
def test(self):
|
||||||
reality = make_repo.extract_blinfo(test_file)
|
reality = bpkg-repogen.extract_blinfo(test_file)
|
||||||
with (self.helper_path / 'expected_blinfo').open("r") as f:
|
with (self.helper_path / 'expected_blinfo').open("r") as f:
|
||||||
expectation = ast.literal_eval(f.read())
|
expectation = ast.literal_eval(f.read())
|
||||||
self.assertEqual(expectation, reality)
|
self.assertEqual(expectation, reality)
|
||||||
@@ -53,8 +53,8 @@ def generate_good_blinfo_test(test_file: Path):
|
|||||||
|
|
||||||
def generate_bad_blinfo_test(test_file: Path):
|
def generate_bad_blinfo_test(test_file: Path):
|
||||||
def test(self):
|
def test(self):
|
||||||
with self.assertRaises(make_repo.BadAddon):
|
with self.assertRaises(bpkg-repogen.BadAddon):
|
||||||
make_repo.extract_blinfo(test_file)
|
bpkg-repogen.extract_blinfo(test_file)
|
||||||
return test
|
return test
|
||||||
|
|
||||||
# Add test method retur
|
# Add test method retur
|
||||||
|
Reference in New Issue
Block a user