Example #1
0
 def test_update_changes_modified(self, session):
     repo = Repo(self.p, **self.data)
     initial_timestamp = repo.modified.time()
     session.commit()
     repo.distro = "centos"
     session.commit()
     assert initial_timestamp < repo.modified.time()
Example #2
0
 def test_can_create_with_many_archs(self, session):
     repo = Repo(self.p, **self.data)
     arch1 = Arch(name="x86_64", repo=repo)
     arch2 = Arch(name="arm64", repo=repo)
     session.commit()
     repo = Repo.get(1)
     assert arch1 in repo.archs
     assert arch2 in repo.archs
Example #3
0
 def test_can_create(self, session):
     Repo(self.p, **self.data)
     session.commit()
     repo = Repo.get(1)
     assert repo.project.name == "ceph"
     assert repo.distro == "ubuntu"
     assert repo.distro_version == "trusty"
     assert repo.flavor == "default"
Example #4
0
 def test_delete_will_delete_arch(self, session):
     repo = Repo(self.p, **self.data)
     Arch(name="x86_64", repo=repo)
     session.commit()
     repo = Repo.get(1)
     repo.delete()
     session.commit()
     assert not Repo.query.first()
     assert not Arch.query.first()
Example #5
0
 def test_can_create_with_arch(self, session):
     repo = Repo(self.p, **self.data)
     arch = Arch(name="x86_64", repo=repo)
     session.commit()
     repo = Repo.get(1)
     assert arch in repo.archs
Example #6
0
 def test_sets_modified(self, session):
     repo = Repo(self.p, **self.data)
     session.commit()
     assert repo.modified.timetuple()
Example #7
0
 def test_can_create_with_extra(self, session):
     r = Repo(self.p, **self.data)
     r.extra = dict(version="10.2.2")
     session.commit()
     repo = Repo.get(1)
     assert repo.extra['version'] == "10.2.2"
Example #8
0
 def setup(self):
     self.p = Project("ceph")
     self.data = base_repo_data()
     self.repo = Repo(self.p, **self.data)
     Arch(name="x86_64", repo=self.repo)