Esempio n. 1
0
    def test_multi_js_file(self):
        """Should handle an array of js file names"""
        files = ["js/test/libs/jasmine-djangojs.js", "js/test/libs/jasmine.js"]
        result = StorageGlobber.glob(files)

        self.assertIn(normpath("js/test/libs/jasmine-djangojs.js"), result)
        self.assertIn(normpath("js/test/libs/jasmine.js"), result)
Esempio n. 2
0
    def test_multi_js_file(self):
        '''Should handle an array of js file names'''
        files = ['js/test/libs/jasmine-djangojs.js', 'js/test/libs/jasmine.js']
        result = StorageGlobber.glob(files)

        self.assertIn('js/test/libs/jasmine-djangojs.js', result)
        self.assertIn('js/test/libs/jasmine.js', result)
Esempio n. 3
0
    def test_multi_js_file(self):
        '''Should handle an array of js file names'''
        files = ['js/test/libs/jasmine-djangojs.js', 'js/test/libs/jasmine.js']
        result = StorageGlobber.glob(files)

        self.assertIn('js/test/libs/jasmine-djangojs.js', result)
        self.assertIn('js/test/libs/jasmine.js', result)
Esempio n. 4
0
    def get_context_data(self, **kwargs):
        context = super(JsTestView, self).get_context_data(**kwargs)

        context['js_test_files'] = StorageGlobber.glob(self.js_files)
        context['use_django_js'] = self.django_js
        context['use_query'] = self.jquery

        return context
Esempio n. 5
0
    def test_single_glob_expression(self):
        """Should handle a single glob pattern as js file list"""
        files = "js/test/libs/jasmine-*.js"
        result = StorageGlobber.glob(files)

        self.assertIn(normpath("js/test/libs/jasmine-djangojs.js"), result)
        self.assertIn(normpath("js/test/libs/jasmine-html.js"), result)
        self.assertIn(normpath("js/test/libs/jasmine-jquery.js"), result)
        self.assertNotIn(normpath("js/test/libs/jasmine.js"), result)
Esempio n. 6
0
    def test_single_glob_expression(self):
        '''Should handle a single glob pattern as js file list'''
        files = 'js/test/libs/jasmine-*.js'
        result = StorageGlobber.glob(files)

        self.assertIn('js/test/libs/jasmine-djangojs.js', result)
        self.assertIn('js/test/libs/jasmine-html.js', result)
        self.assertIn('js/test/libs/jasmine-jquery.js', result)
        self.assertNotIn('js/test/libs/jasmine.js', result)
Esempio n. 7
0
    def test_single_glob_expression(self):
        '''Should handle a single glob pattern as js file list'''
        files = 'js/test/libs/jasmine-*.js'
        result = StorageGlobber.glob(files)

        self.assertIn('js/test/libs/jasmine-djangojs.js', result)
        self.assertIn('js/test/libs/jasmine-html.js', result)
        self.assertIn('js/test/libs/jasmine-jquery.js', result)
        self.assertNotIn('js/test/libs/jasmine.js', result)
Esempio n. 8
0
    def test_multi_glob_expression(self):
        '''Should handle a glob pattern list as js file list'''
        files = ['js/test/libs/jasmine-*.js', 'js/test/libs/qunit-*.js']
        result = StorageGlobber.glob(files)

        self.assertIn('js/test/libs/jasmine-djangojs.js', result)
        self.assertIn('js/test/libs/jasmine-html.js', result)
        self.assertIn('js/test/libs/jasmine-jquery.js', result)
        self.assertIn('js/test/libs/qunit-tap.js', result)
        self.assertNotIn('js/test/libs/jasmine.js', result)
        self.assertNotIn('js/test/libs/qunit.js', result)
Esempio n. 9
0
    def test_multi_glob_expression(self):
        '''Should handle a glob pattern list as js file list'''
        files = ['js/test/libs/jasmine-*.js', 'js/test/libs/qunit-*.js']
        result = StorageGlobber.glob(files)

        self.assertIn('js/test/libs/jasmine-djangojs.js', result)
        self.assertIn('js/test/libs/jasmine-html.js', result)
        self.assertIn('js/test/libs/jasmine-jquery.js', result)
        self.assertIn('js/test/libs/qunit-tap.js', result)
        self.assertNotIn('js/test/libs/jasmine.js', result)
        self.assertNotIn('js/test/libs/qunit.js', result)
Esempio n. 10
0
    def test_multi_glob_expression(self):
        """Should handle a glob pattern list as js file list"""
        files = ["js/test/libs/jasmine-*.js", "js/test/libs/qunit-*.js"]
        result = StorageGlobber.glob(files)

        self.assertIn(normpath("js/test/libs/jasmine-djangojs.js"), result)
        self.assertIn(normpath("js/test/libs/jasmine-html.js"), result)
        self.assertIn(normpath("js/test/libs/jasmine-jquery.js"), result)
        self.assertIn(normpath("js/test/libs/qunit-tap.js"), result)
        self.assertNotIn(normpath("js/test/libs/jasmine.js"), result)
        self.assertNotIn(normpath("js/test/libs/qunit.js"), result)
Esempio n. 11
0
    def test_preserve_order(self):
        """Should preserve declaration order"""
        # Orders matters: should not be an alphabeticaly sorted list
        files = ["js/test/libs/jasmine.js", "js/djangojs/django.js", "js/test/libs/qunit-*.js"]
        result = StorageGlobber.glob(files)

        self.assertEqual(result[0], normpath("js/test/libs/jasmine.js"))
        self.assertEqual(result[1], normpath("js/djangojs/django.js"))

        for lib in result[2:]:
            self.assertIn(normpath("js/test/libs/qunit-"), lib)
            self.assertTrue(lib.endswith(".js"))
Esempio n. 12
0
    def test_preserve_order(self):
        '''Should preserve declaration order'''
        # Orders matters: should not be an alphabeticaly sorted list
        files = ['js/test/libs/jasmine.js', 'js/djangojs/django.js', 'js/test/libs/qunit-*.js']
        result = StorageGlobber.glob(files)

        self.assertEqual(result[0], 'js/test/libs/jasmine.js')
        self.assertEqual(result[1], 'js/djangojs/django.js')

        for lib in result[2:]:
            self.assertIn('js/test/libs/qunit-', lib)
            self.assertTrue(lib.endswith('.js'))
Esempio n. 13
0
    def test_preserve_order(self):
        '''Should preserve declaration order'''
        # Orders matters: should not be an alphabeticaly sorted list
        files = [
            'js/test/libs/jasmine.js', 'js/djangojs/django.js',
            'js/test/libs/qunit-*.js'
        ]
        result = StorageGlobber.glob(files)

        self.assertEqual(result[0], 'js/test/libs/jasmine.js')
        self.assertEqual(result[1], 'js/djangojs/django.js')

        for lib in result[2:]:
            self.assertIn('js/test/libs/qunit-', lib)
            self.assertTrue(lib.endswith('.js'))
Esempio n. 14
0
 def test_no_js_file(self):
     """Should handle empty js file list"""
     self.assertEqual(StorageGlobber.glob(), [])
Esempio n. 15
0
 def test_no_js_file(self):
     '''Should handle empty js file list'''
     # view = JsTestView()
     self.assertEqual(StorageGlobber.glob(), [])
Esempio n. 16
0
 def test_single_js_file(self):
     """Should handle a single js file name as string"""
     files = "js/test/libs/jasmine-djangojs.js"
     expected = [normpath("js/test/libs/jasmine-djangojs.js")]
     self.assertEqual(StorageGlobber.glob(files), expected)
Esempio n. 17
0
 def test_no_js_file(self):
     '''Should handle empty js file list'''
     # view = JsTestView()
     self.assertEqual(StorageGlobber.glob(), [])
Esempio n. 18
0
 def get_context_data(self, **kwargs):
     return {
         'js_test_files': StorageGlobber.glob(self.js_files),
         'use_query': self.jquery
     }
Esempio n. 19
0
 def test_single_js_file(self):
     '''Should handle a single js file name as string'''
     files = 'js/test/libs/jasmine-djangojs.js'
     expected = ['js/test/libs/jasmine-djangojs.js']
     self.assertEqual(StorageGlobber.glob(files), expected)
Esempio n. 20
0
 def get_context_data(self, **kwargs):
     return {
         'js_test_files': StorageGlobber.glob(self.js_files),
         'use_query': self.jquery
     }
Esempio n. 21
0
 def test_single_js_file(self):
     '''Should handle a single js file name as string'''
     files = 'js/test/libs/jasmine-djangojs.js'
     expected = ['js/test/libs/jasmine-djangojs.js']
     self.assertEqual(StorageGlobber.glob(files), expected)