Example #1
0
 def test_CreationOfGitattributes_ExistAlready_ShouldntGetCreated(self):
     with testhelper.mkchdir("aFolder") as folder:
         configuration.config = Builder().setworkdirectory(folder).setgitreponame("test.git").setgitattributes(["# comment", "*.sql text"]).build()
         attributes = '.gitattributes'
         existing_git_attribute_entry = "* text=auto"
         Initializer().createrepo()
         with open(attributes, 'w') as gitattributes:
             gitattributes.write(existing_git_attribute_entry)
         Initializer.createattributes()
         with open(attributes, 'r') as gitattributes:
             for line in gitattributes.readlines():
                 self.assertEqual(existing_git_attribute_entry, line)
Example #2
0
 def test_CreationOfGitattributes_DoesntExist_ShouldGetCreated(self):
     with testhelper.mkchdir("aFolder") as folder:
         configuration.config = Builder().setworkdirectory(folder).setgitreponame("test.git").setgitattributes(["# comment", "* text=auto"]).build()
         attributes = '.gitattributes'
         Initializer().createrepo()
         Initializer.createattributes()
         gitattributespath = os.path.join(os.getcwd(), attributes)
         self.assertTrue(os.path.exists(gitattributespath))
         with open(gitattributespath, 'r') as gitattributes:
             lines = gitattributes.readlines()
             self.assertEqual(2, len(lines))
             self.assertEquals('# comment\n', lines[0])
             self.assertEquals('* text=auto\n', lines[1])