def test_minified_properties(self): propLines = [ "# Comments are removed", "foo = bar", "", "# Another comment", ] prop = GeneratedFile("\n".join(propLines)) self.assertEqual( MinifiedProperties(prop).open().readlines(), [b"foo = bar\n", b"\n"] ) open(self.tmppath("prop"), "w").write("\n".join(propLines)) MinifiedProperties(File(self.tmppath("prop"))).copy(self.tmppath("prop2")) self.assertEqual(open(self.tmppath("prop2")).readlines(), ["foo = bar\n", "\n"])
def test_minified_properties(self): propLines = [ '# Comments are removed', 'foo = bar', '', '# Another comment', ] prop = GeneratedFile('\n'.join(propLines)) self.assertEqual( MinifiedProperties(prop).open().readlines(), ['foo = bar\n', '\n']) open(self.tmppath('prop'), 'wb').write('\n'.join(propLines)) MinifiedProperties(File(self.tmppath('prop'))) \ .copy(self.tmppath('prop2')) self.assertEqual( open(self.tmppath('prop2')).readlines(), ['foo = bar\n', '\n'])