示例#1
0
 def test_with_non_sql_files(self):
     """
     Files with extensions other than ".sql" are ignored.
     """
     touch("%s/01-not-a-sql-file.txt" % self.path1)
     touch("%s/01-no-sql-extensionsql" % self.path2)
     self.assertEqual([], find_scripts(self.top))
示例#2
0
 def test_with_files_in_dir_too_deep_in_hierarchy(self):
     """
     Files too far up or too far down will be ignored.
     """
     touch("%s/01-too-far-up.sql" % self.top)
     touch("%s/01-too-far-down.sql" % self.path1d)
     self.assertEqual([], find_scripts(self.top))
示例#3
0
 def test_with_non_sql_files(self):
     """
     Files with extensions other than ".sql" are ignored.
     """
     touch("%s/01-not-a-sql-file.txt" % self.path1)
     touch("%s/01-no-sql-extensionsql" % self.path2)
     self.assertEqual([], find_scripts(self.top))
示例#4
0
 def test_with_files_in_dir_too_deep_in_hierarchy(self):
     """
     Files too far up or too far down will be ignored.
     """
     touch("%s/01-too-far-up.sql" % self.top)
     touch("%s/01-too-far-down.sql" % self.path1d)
     self.assertEqual([], find_scripts(self.top))
示例#5
0
 def test_with_files_at_level_two(self):
     """
     Files that are at level 3 relative to the artefact subdirectory will be
     found.
     """
     touch("%s/01-a.sql" % self.path1)
     touch("%s/02-b.sql" % self.path1)
     touch("%s/01-a.sql" % self.path2)
     self.assertEqual(["1/01-a.sql", "1/02-b.sql", "2/01-a.sql"],
                      list(sorted(find_scripts(self.top))))
 def test_with_files_at_level_two(self):
     """
     Files that are at level 3 relative to the artefact subdirectory will be
     found.
     """
     touch("%s/01-a.sql" % self.path1)
     touch("%s/02-b.sql" % self.path1)
     touch("%s/01-a.sql" % self.path2)
     self.assertEqual(["1/01-a.sql", "1/02-b.sql", "2/01-a.sql"],
                      list(sorted(find_scripts(self.top))))