Пример #1
0
 def test_installFile_existing_differing(self):
     self.writeFile('test/srcfile', 'source data')
     self.writeFile('test/destfile', 'dest data')
     upgrade_master.installFile(mkconfig(), 'test/destfile', 'test/srcfile')
     self.assertEqual(self.readFile('test/destfile'), 'dest data')
     self.assertEqual(self.readFile('test/destfile.new'), 'source data')
     self.assertInStdout('writing new contents to')
Пример #2
0
 def test_installFile_existing_same(self):
     self.writeFile('test/srcfile', 'source data')
     self.writeFile('test/destfile', 'source data')
     upgrade_master.installFile(mkconfig(), 'test/destfile', 'test/srcfile')
     self.assertEqual(self.readFile('test/destfile'), 'source data')
     self.assertFalse(os.path.exists('test/destfile.new'))
     self.assertWasQuiet()
Пример #3
0
 def test_installFile_existing_differing_overwrite(self):
     self.writeFile('test/srcfile', 'source data')
     self.writeFile('test/destfile', 'dest data')
     upgrade_master.installFile(mkconfig(), 'test/destfile', 'test/srcfile',
                                overwrite=True)
     self.assertEqual(self.readFile('test/destfile'), 'source data')
     self.assertFalse(os.path.exists('test/destfile.new'))
     self.assertInStdout('overwriting')
 def test_installFile_existing_differing_overwrite(self):
     self.writeFile('test/srcfile', 'source data')
     self.writeFile('test/destfile', 'dest data')
     upgrade_master.installFile(mkconfig(), 'test/destfile', 'test/srcfile',
                                overwrite=True)
     self.assertEqual(self.readFile('test/destfile'), 'source data')
     self.assertFalse(os.path.exists('test/destfile.new'))
     self.assertInStdout('overwriting')
Пример #5
0
 def test_installFile_quiet(self):
     self.writeFile('test/srcfile', 'source data')
     upgrade_master.installFile(mkconfig(quiet=True), 'test/destfile',
                                'test/srcfile')
     self.assertWasQuiet()
Пример #6
0
 def test_installFile(self):
     self.writeFile('test/srcfile', 'source data')
     upgrade_master.installFile(mkconfig(), 'test/destfile', 'test/srcfile')
     self.assertEqual(self.readFile('test/destfile'), 'source data')
     self.assertInStdout('creating test/destfile')
 def test_installFile_quiet(self):
     self.writeFile('test/srcfile', 'source data')
     upgrade_master.installFile(mkconfig(quiet=True), 'test/destfile',
                                'test/srcfile')
     self.assertWasQuiet()
 def test_installFile(self):
     self.writeFile('test/srcfile', 'source data')
     upgrade_master.installFile(mkconfig(), 'test/destfile', 'test/srcfile')
     self.assertEqual(self.readFile('test/destfile'), 'source data')
     self.assertInStdout('creating test/destfile')