def testAbsolutify(self): layout = mod.BaseTestLayout() self.assertEquals(layout.absolutify("foo/bar.py"), "%s/foo/bar.py" % proj_root) self.assertEquals(layout.absolutify("/tmp/foo/bar.py"), "/tmp/foo/bar.py")
def testRelatize(self): layout = mod.BaseTestLayout() self.assertEquals(layout.relatize("%s/foo/bar.py" % proj_root), "foo/bar.py") self.assertEquals(layout.relatize("foo/bar.py"), "foo/bar.py")
def testGlueWithUnderUnderInits(self): layout = mod.BaseTestLayout() self.assertEquals(layout.glue_parts(['foo'], True), 'foo/__init__.py') self.assertEquals(layout.glue_parts(['foo', 'bar', 'baz'], True), 'foo/bar/baz/__init__.py') self.assertEquals(layout.glue_parts([], True), '__init__.py')
def testGlueSimple(self): layout = mod.BaseTestLayout() self.assertEquals(layout.glue_parts(['foo']), 'foo.py') self.assertEquals(layout.glue_parts(['foo', 'bar', 'baz']), 'foo/bar/baz.py') self.assertRaises(IndexError, layout.glue_parts, [])
def testBreakDownWithUnderUnderInits(self): layout = mod.BaseTestLayout() self.assertEquals(layout.break_down('__init__.py'), []) self.assertEquals(layout.break_down('foo/__init__.py'), ['foo']) self.assertEquals(layout.break_down('foo/bar/baz/__init__.py'), ['foo', 'bar', 'baz'])
def testBreakDownSimple(self): layout = mod.BaseTestLayout() self.assertEquals(layout.break_down('foo.py'), ['foo']) self.assertEquals(layout.break_down('foo/bar.py'), ['foo', 'bar']) self.assertEquals(layout.break_down('foo/bar/baz.py'), ['foo', 'bar', 'baz'])