Exemplo n.º 1
0
class TestJSONIndex(unittest.TestCase):
  def setUp(self):
    self.index = JSONIndex()

  def testBasicManifest(self):
    self.index.src = '../templates/examples/basic/manifest.json'
    self.assertEqual(self.index.manifest.name,"example")
    self.assertEqual(self.index.manifest.version,"1.0")
    self.assertEqual(self.index.manifest.build.dir,'lib')

    self.index.import_manifest()

    dps = self.index.dependencies
    self.assertEqual( dps[0].working_dir, '../templates/examples/basic/lib' )
    self.assertEqual( dps[1].working_dir, '../templates/examples/basic/lib/foo' )
    self.assertEqual( dps[2].working_dir, '../templates/examples/basic/lib/bar' )
  
  def testNestedManifests(self):
    self.index.src = '../templates/examples/nested/manifest.json'
    self.index.import_manifest()
    self.assertEqual(self.index.manifest.name,"example")
    self.assertEqual(self.index.manifest.version,"1.0")
    self.assertEqual(self.index.manifest.build.dir,'lib')

    dps = self.index.dependencies
    self.assertEqual( dps[0].working_dir, '../templates/examples/nested/lib' )
    self.assertEqual( dps[1].working_dir, '../templates/examples/nested/lib/foo' )
    self.assertEqual( len(dps[1].dependencies), 1)
    self.assertEqual( dps[1].dependencies[0].filename, 'foo.js')
    self.assertEqual( dps[1].dependencies[0].working_dir, '../templates/examples/nested/lib/foo')
    self.assertEqual( dps[2].working_dir, '../templates/examples/nested/lib/bar' )
Exemplo n.º 2
0
class TestJSONIndex(unittest.TestCase):
    def setUp(self):
        self.index = JSONIndex()

    def testBasicManifest(self):
        self.index.src = '../templates/examples/basic/manifest.json'
        self.assertEqual(self.index.manifest.name, "example")
        self.assertEqual(self.index.manifest.version, "1.0")
        self.assertEqual(self.index.manifest.build.dir, 'lib')

        self.index.import_manifest()

        dps = self.index.dependencies
        self.assertEqual(dps[0].working_dir, '../templates/examples/basic/lib')
        self.assertEqual(dps[1].working_dir,
                         '../templates/examples/basic/lib/foo')
        self.assertEqual(dps[2].working_dir,
                         '../templates/examples/basic/lib/bar')

    def testNestedManifests(self):
        self.index.src = '../templates/examples/nested/manifest.json'
        self.index.import_manifest()
        self.assertEqual(self.index.manifest.name, "example")
        self.assertEqual(self.index.manifest.version, "1.0")
        self.assertEqual(self.index.manifest.build.dir, 'lib')

        dps = self.index.dependencies
        self.assertEqual(dps[0].working_dir,
                         '../templates/examples/nested/lib')
        self.assertEqual(dps[1].working_dir,
                         '../templates/examples/nested/lib/foo')
        self.assertEqual(len(dps[1].dependencies), 1)
        self.assertEqual(dps[1].dependencies[0].filename, 'foo.js')
        self.assertEqual(dps[1].dependencies[0].working_dir,
                         '../templates/examples/nested/lib/foo')
        self.assertEqual(dps[2].working_dir,
                         '../templates/examples/nested/lib/bar')
Exemplo n.º 3
0
 def setUp(self):
   self.index = JSONIndex()
Exemplo n.º 4
0
 def setUp(self):
     self.index = JSONIndex()