Ignore:
Timestamp:
19-05-07 12:08:43 (6 years ago)
Author:
thomas
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/moap/test/test_commands_doap.py

    r193 r228  
    1717        self.ical = os.path.join(os.path.dirname(__file__), 'ical', 
    1818            'mach.ical') 
     19        self.rss = os.path.join(os.path.dirname(__file__), 'rss', 
     20            'mach.rss') 
    1921        self.stdout = StringIO.StringIO() 
    2022        self.command = doap.Doap(stdout=self.stdout) 
     
    2325        ret = self.command.parse(['-f', self.doap, 'ical']) 
    2426        ref = open(self.ical).read() 
     27        self.assertEquals(self.stdout.getvalue(), ref) 
     28 
     29    def testRss(self): 
     30        ret = self.command.parse(['-f', self.doap, 'rss']) 
     31        ref = open(self.rss).read() 
    2532        self.assertEquals(self.stdout.getvalue(), ref) 
    2633 
     
    3744""" % self.doap 
    3845        self.assertEquals(self.stdout.getvalue(), ref) 
     46 
     47class TestDoapUnspecified(common.TestCase): 
     48    # we don't specify the doap file, let doap find it on its own 
     49    def setUp(self): 
     50        self._cwd = os.getcwd() 
     51        doapdir = os.path.join(os.path.dirname(__file__), 'doap') 
     52        os.chdir(doapdir) 
     53        self.stdout = StringIO.StringIO() 
     54        self.command = doap.Doap(stdout=self.stdout) 
     55 
     56    def testShow(self): 
     57        doap = os.path.join(os.path.dirname(__file__), 'doap', 
     58            'mach.doap') 
     59        ret = self.command.parse(['show']) 
     60        ref = u"""DOAP file:         %s 
     61project:           Mach 
     62short description: mach makes chroots 
     63created:           2002-06-06 
     64homepage:          http://thomas.apestaart.org/projects/mach/ 
     65bug database:      https://apestaart.org/thomas/trac/newticket 
     66download page:     http://thomas.apestaart.org/projects/mach/ 
     67Latest release:    version 0.9.0 'Cambria' on branch 2. 
     68""" % doap 
     69        self.assertEquals(self.stdout.getvalue(), ref) 
     70 
     71    def tearDown(self): 
     72        os.chdir(self._cwd) 
Note: See TracChangeset for help on using the changeset viewer.