Beispiel #1
0
 def test_update(self, session, tmpdir, url):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
         sha1="head",
     )
     repo.path = "some_path"
     session.commit()
     repo.get(1)
     repo.needs_update = False
     session.commit()
     result = session.app.post_json(url, params={})
     assert result.json['needs_update'] is True
     assert result.json['is_queued'] is False
Beispiel #2
0
 def test_update(self, session, tmpdir):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
     )
     repo.path = "some_path"
     session.commit()
     repo.get(1)
     repo.needs_update = False
     session.commit()
     result = session.app.post_json(
         "/repos/foobar/firefly/ubuntu/trusty/update",
         params={}
     )
     assert result.json['needs_update'] is True
Beispiel #3
0
 def test_update(self, session, tmpdir, url):
     p = Project('foobar')
     repo = Repo(
         p,
         "firefly",
         "ubuntu",
         "trusty",
         sha1="head",
     )
     repo.path = "some_path"
     session.commit()
     repo.get(1)
     repo.needs_update = False
     session.commit()
     result = session.app.post_json(
         url,
         params={}
     )
     assert result.json['needs_update'] is True
     assert result.json['is_queued'] is False
Beispiel #4
0
    def test_create(self, session, url):
        p = Project('foobar')
        repo = Repo(
            p,
            "firefly",
            "ubuntu",
            "trusty",
            sha1="head",
        )
        repo.path = "some_path"
        session.commit()
        repo.get(1)
        repo.needs_update = False
        session.commit()
        # create a raw type repo
        result = session.app.post_json(
            url,
            params={'type': 'raw'},
        )
        assert result.json['type'] == 'raw'

        # adding an rpm doesn't change the type
        Binary(
            'binary.rpm',
            p,
            repo,
            ref='firefly',
            sha1='head',
            flavor='default',
            distro='ubuntu',
            distro_version='trusty',
            arch='arm64',
        )
        session.commit()
        result = session.app.get(url)
        assert result.json['type'] == 'raw'