Beispiel #1
0
    def setUp(self):
        repo = Mock('repo')
        repo.name = 'standard'
        repo.arch = 'x86_64'

        package = Mock('package')
        package.project = 'openSUSE:11.3'
        package.name = 'osc'

        self.build = obswatch.Build(package=package, repo=repo,
                                  interested={'geeko':'*****@*****.**'})
        self.package = package        
        self.tt = TraceTracker()

        obswatch.SLEEP_TIME = 0
Beispiel #2
0
    def test_get_builds(self):
        mock('osc.core.http_GET', tracker=self.tt,
             returns=StringIO('''<?xml version="1.0" encoding="UTF-8"?>
              <project name="superkde" created="2005-01-01T00:00:02+01:00" updated="2007-01-19T10:44:45+01:00">
              <title>SuperKDE</title>
              <description>SuperKDE is a heavily tuned version of KDE.</description>
              <link project="openSUSE:11.2:Update" />
              <link project="openSUSE:11.2" />
              <person role="maintainer" userid="ernie"/>
              <group  role="reviewer"  groupid="release_team"/>
              <build>

              <disable />
              </build>
              <useforbuild>
              <disable />
              </useforbuild>
              <repository name="kde4:factory" rebuild="transitive">
              <path project="kde4" repository="factory"/>
              <arch>i386</arch>

              <arch>x86_64</arch>
              </repository>
              <repository name="suselinux-9.3">
              <path project="suselinux-9.3" repository="standard"/>
              <arch>i386</arch>
              </repository>
              <repository name="gnomespecial" rebuild="local">
              <path project="gnome3" repository="suselinux-9.3"/>

              <path project="suselinux-9.3" repository="standard"/>
              <arch>i386</arch>
              </repository>
              </project>'''))
        # source/superkde/_meta
        # gets called by osc.core.get_repos_of_project
        mock('obswatch.get_interested',
                      returns={'Geeko': '*****@*****.**'})

        superkde = Mock('package')
        superkde.name = 'superkde'
        superkde.project = 'superkde'
        superkde.created = '2007-01-19T10:44:45+01:00'
        result = obswatch.get_builds(superkde)

        assert_same_trace(self.tt, """Called osc.core.http_GET(
            '%ssource/superkde/_meta')""" % obswatch.APIURL)