Example #1
0
 def test_relative_subfolder(self):
     from requirejs import absolute
     self.assertEqual(
         absolute(
             'assets/script.js',
             '/home/user/project/module/',
             '/home/user/project',
         ), '/home/user/project/module/assets/script.js')
Example #2
0
 def test_in_project_subfolder_absolute(self):
     from requirejs import absolute
     self.assertEqual(
         absolute(
             '/assets/script.js',
             '/home/user/project/module/',
             '/home/user/project',
         ), '/home/user/project/assets/script.js')
Example #3
0
 def test_in_project_root(self):
     from requirejs import absolute
     self.assertEqual(
         absolute(
             '/script.js',
             '/home/user/project/module/',
             '/home/user/project/',
         ), '/home/user/project/script.js')
Example #4
0
 def test_in_caller_parent(self):
     from requirejs import absolute
     self.assertEqual(
         absolute(
             '../script.js',
             '/home/user/project/module/',
             '/home/user/project',
         ), '/home/user/project/script.js')
Example #5
0
 def test_caller_sibling(self):
     from requirejs import absolute
     self.assertEqual(
         absolute(
             'script.js',
             '/home/user/project/module/',
             '/home/user/project',
         ), '/home/user/project/module/script.js')
Example #6
0
 def test_relative_subfolder(self):
     from requirejs import absolute
     self.assertEqual(
         absolute(
             'assets/script.js',
             '/home/user/project/module/',
             '/home/user/project',
         ),
         '/home/user/project/module/assets/script.js'
     )
Example #7
0
 def test_in_project_subfolder_absolute(self):
     from requirejs import absolute
     self.assertEqual(
         absolute(
             '/assets/script.js',
             '/home/user/project/module/',
             '/home/user/project',
         ),
         '/home/user/project/assets/script.js'
     )
Example #8
0
 def test_in_project_root(self):
     from requirejs import absolute
     self.assertEqual(
         absolute(
             '/script.js',
             '/home/user/project/module/',
             '/home/user/project/',
         ),
         '/home/user/project/script.js'
     )
Example #9
0
 def test_in_caller_parent(self):
     from requirejs import absolute
     self.assertEqual(
         absolute(
             '../script.js',
             '/home/user/project/module/',
             '/home/user/project',
         ),
         '/home/user/project/script.js'
     )
Example #10
0
 def test_caller_sibling(self):
     from requirejs import absolute
     self.assertEqual(
         absolute(
             'script.js',
             '/home/user/project/module/',
             '/home/user/project',
         ),
         '/home/user/project/module/script.js'
     )