Пример #1
0
    def test_find_location_with_prefix_in_path(self):
        prefix = 'tethys_app'
        path = 'tethys_app/css/main.css'

        tethys_static_finder = TethysStaticFinder()
        ret = tethys_static_finder.find_location(self.root, path, prefix)

        self.assertEqual(os.path.join(self.root, 'css/main.css'), ret)
Пример #2
0
    def test_find_location_with_prefix_not_in_path(self):
        prefix = 'tethys_app'
        path = 'css/main.css'

        tethys_static_finder = TethysStaticFinder()
        ret = tethys_static_finder.find_location(self.root, path, prefix)

        self.assertIsNone(ret)
Пример #3
0
    def test_find_location_with_no_prefix(self):
        prefix = None
        path = 'css/main.css'

        tethys_static_finder = TethysStaticFinder()
        ret = tethys_static_finder.find_location(self.root, path, prefix)

        self.assertEqual(os.path.join(self.root, path), ret)
Пример #4
0
    def test_find_location_with_prefix_in_path(self):
        prefix = 'tethys_app'
        path = 'tethys_app/css/main.css'

        tethys_static_finder = TethysStaticFinder()
        ret = tethys_static_finder.find_location(self.root, path, prefix)

        self.assertEqual(os.path.join(self.root, 'css/main.css'), ret)
Пример #5
0
    def test_find_location_with_prefix_not_in_path(self):
        prefix = 'tethys_app'
        path = 'css/main.css'

        tethys_static_finder = TethysStaticFinder()
        ret = tethys_static_finder.find_location(self.root, path, prefix)

        self.assertIsNone(ret)
Пример #6
0
    def test_find_location_with_no_prefix(self):
        prefix = None
        path = 'css/main.css'

        tethys_static_finder = TethysStaticFinder()
        ret = tethys_static_finder.find_location(self.root, path, prefix)

        self.assertEqual(os.path.join(self.root, path), ret)