Skip to content

Commit

Permalink
test: remove old tests from test_repo.py
Browse files Browse the repository at this point in the history
  • Loading branch information
james-garner-canonical committed Dec 5, 2024
1 parent 709e2c7 commit 2820497
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions tests/unit/test_repo.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.

import os

import pytest
from charms.operator_libs_linux.v0 import apt
from pyfakefs.fake_filesystem_unittest import TestCase

Expand Down Expand Up @@ -89,23 +86,6 @@ def test_can_disable_repositories(self):
open(other.filename).readlines(),
)

@pytest.mark.skip("RepositoryMapping.add now calls apt-add-repository")
def test_can_add_repositories(self):
r = apt.RepositoryMapping()
d = apt.DebianRepository(
True,
"deb",
"http://example.com",
"test",
["group"],
"/etc/apt/sources.list.d/example-test.list",
)
r.add(d, default_filename=False)
self.assertIn(
"{} {} {} {}\n".format(d.repotype, d.uri, d.release, " ".join(d.groups)),
open(d.filename).readlines(),
)

def test_can_create_repo_from_repo_line(self):
d = apt.DebianRepository.from_repo_line(
"deb https://example.com/foo focal bar baz",
Expand All @@ -118,23 +98,6 @@ def test_can_create_repo_from_repo_line(self):
self.assertEqual(d.groups, ["bar", "baz"])
self.assertEqual(d.filename, "/etc/apt/sources.list.d/foo-focal.list")

@pytest.mark.skip("RepositoryMapping.add now calls apt-add-repository")
def test_valid_list_file(self):
line = "deb https://repo.example.org/fiz/baz focal/foo-bar/5.0 multiverse"
d = apt.DebianRepository.from_repo_line(line)
self.assertEqual(d.filename, "/etc/apt/sources.list.d/fiz-baz-focal-foo-bar-5.0.list")

r = apt.RepositoryMapping()
d = apt.DebianRepository(
True,
"deb",
"https://repo.example.org/fiz/baz",
"focal/foo-bar/5.0",
["multiverse"],
)
r.add(d, default_filename=False)
assert os.path.exists("/etc/apt/sources.list.d/fiz-baz-focal-foo-bar-5.0.list")

def test_can_add_repositories_from_string_with_options(self):
d = apt.DebianRepository.from_repo_line(
"deb [signed-by=/foo/gpg.key arch=amd64] https://example.com/foo focal bar baz",
Expand Down

0 comments on commit 2820497

Please sign in to comment.