def test_outdated(self, depfile_name, rm_generated_deps): control = IncrementalControl([SAMPLE_DIR]) control.DB_FILE = depfile_name control.test_files = [self.tt_mod1, self.tt_mod2] # at first all are outdated got = control.get_outdated() assert set(got.keys()) == set([self.tt_mod1, self.tt_mod2]) # save one success and check outdated control.save_success([self.tt_mod2]) assert set(control.get_outdated().keys()) == set([self.tt_mod1])
def test_outdated(self, depfile_name, rm_generated_deps): control = IncrementalControl([SAMPLE_DIR]) control.DB_FILE = depfile_name control.test_files = [self.tt_mod1, self.tt_mod2] # at first all are outdated got = control.get_outdated() assert set(got.keys()) == set([self.tt_mod1, self.tt_mod2]) # save one success and check outdated control.save_success([self.tt_mod2]) assert set(control.get_outdated().keys()) == set([self.tt_mod1])
def test_list_deps(self, depfile_name, rm_generated_deps, capsys): control = IncrementalControl([SAMPLE_DIR]) control.DB_FILE = depfile_name control.test_files = [self.tt_mod1, self.tt_mod2] control.print_deps() out = capsys.readouterr()[0].splitlines() assert len(out) == 6 assert " - dodo.py: dodo.py" in out assert " - mod1.py: mod1.py" in out assert " - mod2.py: mod1.py, mod2.py" in out assert " - tt/conftest.py: tt/conftest.py" in out assert " - tt/tt_mod1.py: mod1.py, tt/conftest.py, tt/tt_mod1.py" in out mod2_deps = "mod1.py, mod2.py, tt/conftest.py, tt/tt_mod2.py" assert " - tt/tt_mod2.py: " + mod2_deps in out
def test_list_deps(self, depfile_name, rm_generated_deps, capsys): control = IncrementalControl([SAMPLE_DIR]) control.DB_FILE = depfile_name control.test_files = [self.tt_mod1, self.tt_mod2] control.print_deps() out = capsys.readouterr()[0].splitlines() assert len(out) == 6 assert ' - dodo.py: dodo.py' in out assert ' - mod1.py: mod1.py' in out assert ' - mod2.py: mod1.py, mod2.py' in out assert ' - tt/conftest.py: tt/conftest.py' in out assert ' - tt/tt_mod1.py: mod1.py, tt/conftest.py, tt/tt_mod1.py' in out mod2_deps = 'mod1.py, mod2.py, tt/conftest.py, tt/tt_mod2.py' assert ' - tt/tt_mod2.py: ' + mod2_deps in out
def test_dot_graph(self, depfile_name, rm_generated_deps): control = IncrementalControl([SAMPLE_DIR]) control.DB_FILE = depfile_name control.test_files = [self.tt_mod1, self.tt_mod2] control.create_dot_graph() dot = open(os.path.join(SAMPLE_DIR, "deps.dot")).read() out = dot.splitlines() assert len(out) == 9 assert "rankdir = BT" in out assert '"dodo.py"' in out assert '"mod1.py"' in out assert '"mod2.py" -> "mod1.py"' in out assert '"tt/conftest.py"' in out assert '"tt/tt_mod1.py" -> "mod1.py"' in out assert '"tt/tt_mod2.py" -> "mod2.py"' in out
def test_dot_graph(self, depfile_name, rm_generated_deps): control = IncrementalControl([SAMPLE_DIR]) control.DB_FILE = depfile_name control.test_files = [self.tt_mod1, self.tt_mod2] control.create_dot_graph() dot = open(os.path.join(SAMPLE_DIR, 'deps.dot')).read() out = dot.splitlines() assert len(out) == 9 assert 'rankdir = BT' in out assert '"dodo.py"' in out assert '"mod1.py"' in out assert '"mod2.py" -> "mod1.py"' in out assert '"tt/conftest.py"' in out assert '"tt/tt_mod1.py" -> "mod1.py"' in out assert '"tt/tt_mod2.py" -> "mod2.py"' in out