| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6d8952c commit 7587ad8
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,7 @@ | |||
| 1 | 1 | # -*- coding: utf-8 -*- | |
| 2 | 2 | ||
| 3 | + import os | ||
| 4 | + | ||
| 3 | 5 | try: | |
| 4 | 6 | import unittest2 as unittest | |
| 5 | 7 | except ImportError: | |
@@ -102,5 +104,20 @@ def test_get_source_latin1(self): | |||
| 102 | 104 | self.assertEqual(inspection.get_source_unicode(encoding_latin1.foo), | |
| 103 | 105 | foo_non_ascii) | |
| 104 | 106 | ||
| 107 | + def test_get_source_file(self): | ||
| 108 | + path = os.path.join(os.path.dirname(os.path.abspath(__file__)), | ||
| 109 | + 'fodder') | ||
| 110 | + | ||
| 111 | + encoding = inspection.get_encoding_file( | ||
| 112 | + os.path.join(path, 'encoding_ascii.py')) | ||
| 113 | + self.assertEqual(encoding, 'ascii') | ||
| 114 | + encoding = inspection.get_encoding_file( | ||
| 115 | + os.path.join(path, 'encoding_latin1.py')) | ||
| 116 | + self.assertEqual(encoding, 'latin1') | ||
| 117 | + encoding = inspection.get_encoding_file( | ||
| 118 | + os.path.join(path, 'encoding_utf8.py')) | ||
| 119 | + self.assertEqual(encoding, 'utf-8') | ||
| 120 | + | ||
| 121 | + | ||
| 105 | 122 | if __name__ == '__main__': | |
| 106 | 123 | unittest.main() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments