Restore old function check_file.

This commit is contained in:
Andrey Smirnov
2014-02-02 20:08:51 +04:00
parent 996fc445be
commit 0dd44f98b8
2 changed files with 8 additions and 5 deletions
+4 -1
View File
@@ -113,11 +113,14 @@ class BaseTest(object):
with open(os.path.join(os.environ["HOME"], ".aptly", path), "r") as f:
return f.read()
def check_file(self, path, gold_name, match_prepare=None):
def check_file_contents(self, path, gold_name, match_prepare=None):
contents = self.read_file(path)
self.verify_match(self.get_gold(gold_name), contents, match_prepare=match_prepare)
def check_file(self):
self.verify_match(self.get_gold(), open(self.checkedFile, "r").read())
def check_exists(self, path):
if not os.path.exists(os.path.join(os.environ["HOME"], ".aptly", path)):
raise Exception("path %s doesn't exist" % (path, ))