Skip to content

Commit

Permalink
Update nas test for major_version check
Browse files Browse the repository at this point in the history
  • Loading branch information
mreid-tt committed Jan 10, 2024
1 parent d8e5dbe commit 5e53c31
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions spkrepo/tests/test_nas.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ def test_stable_build_active_stable(self):
catalog[0], build, data, dict(arch="88f628x", build="1594")
)

def test_stable_build_active_stable_5004(self):
def test_stable_noarch_build_active_stable_5004(self):
build = BuildFactory(
active=True,
version__report_url=None,
architectures=[Architecture.find("88f6281", syno=True)],
architectures=[Architecture.find("noarch", syno=True)],
firmware=Firmware.find(1594),
)
db.session.commit()
Expand All @@ -247,6 +247,23 @@ def test_stable_build_active_stable_5004(self):
catalog["packages"][0], build, data, dict(arch="88f628x", build="5004")
)

def test_stable_arch_build_active_stable_5004(self):
BuildFactory(
active=True,
version__report_url=None,
architectures=[Architecture.find("88f6281", syno=True)],
firmware=Firmware.find(1594),
)
db.session.commit()
data = dict(arch="88f6281", build="5004", language="enu")
response = self.client.post(url_for("nas.catalog"), data=data)
self.assert200(response)
self.assertHeader(response, "Content-Type", "application/json")
catalog = json.loads(response.data.decode())
self.assertIn("packages", catalog)
self.assertIn("keyrings", catalog)
self.assertEqual(len(catalog["packages"]), 0)

def test_stable_build_active_stable_download_count(self):
package = PackageFactory()
build = BuildFactory(
Expand Down

0 comments on commit 5e53c31

Please sign in to comment.