예제 #1
0
    def test_not_empty(self):
        res, kw = _empty_file_sniffer(io.StringIO("a"))
        self.assertFalse(res)
        self.assertEqual({}, kw)

        res, kw = _empty_file_sniffer(io.StringIO("                  \n \ta"))
        self.assertFalse(res)
        self.assertEqual({}, kw)
예제 #2
0
    def test_empty(self):
        res, kw = _empty_file_sniffer(io.StringIO())
        self.assertTrue(res)
        self.assertEqual({}, kw)

        res, kw = _empty_file_sniffer(io.StringIO("       \n   \t "))
        self.assertTrue(res)
        self.assertEqual({}, kw)