def test_detect_body(self): for x in '0 1'.split(): n = 'tmp.java.' + x self.assertEqual('java', Detector.detect(n))
def test_detect_body(self): for x in '0 1 2'.split(): n = 'tmp.c.' + x self.assertEqual('c', Detector.detect(n))
def test_detect_ext(self): for x in 'java js'.split(): n = 'tmp.empty.' + x self.assertEqual('java', Detector.detect(n))
def test_detect_ext(self): for x in self.EXT: n = 'tmp.empty.' + x self.assertEqual('c', Detector.detect(n))
def test_detect_body(self): for x in '0 1 2 3 4'.split(): n = 'tmp.xml.' + x self.assertEqual('xml', Detector.detect(n))
def test_detect_ext(self): for x in ['py']: n = 'tmp.empty.' + x self.assertEqual('py', Detector.detect(n))
def test_detect_body(self): self.assertEqual('go', Detector.detect('tmp.go.0', autodetect=True)) self.assertIsNone(Detector.detect('tmp.go.0'))
def test_detect_body(self): for x in '0 1 2'.split(): n = 'tmp.c.' + x self.assertEqual('c', Detector.detect(n, autodetect=True)) self.assertIsNone(Detector.detect(n))