MCPcopy Create free account
hub / github.com/saltstack/salt / test_stash

Method test_stash

tests/integration/modules/test_git.py:792–819  ·  view source on GitHub ↗

Test git.stash # TODO: test more stash actions

(self)

Source from the content-addressed store, hash-verified

790
791 @pytest.mark.slow_test
792 def test_stash(self):
793 """
794 Test git.stash
795
796 # TODO: test more stash actions
797 """
798 file_path = os.path.join(self.repo, self.files[0])
799 with salt.utils.files.fopen(file_path, "a") as fp_:
800 fp_.write("Temp change to be stashed")
801 self.assertTrue("ERROR" not in self.run_function("git.stash", [self.repo]))
802 # List stashes
803 ret = self.run_function("git.stash", [self.repo], action="list")
804 self.assertTrue("ERROR" not in ret)
805 self.assertTrue(len(ret.splitlines()) == 1)
806 # Apply the stash
807 self.assertTrue(
808 "ERROR"
809 not in self.run_function(
810 "git.stash", [self.repo], action="apply", opts="stash@{0}"
811 )
812 )
813 # Drop the stash
814 self.assertTrue(
815 "ERROR"
816 not in self.run_function(
817 "git.stash", [self.repo], action="drop", opts="stash@{0}"
818 )
819 )
820
821 @pytest.mark.slow_test
822 def test_status(self):

Callers

nothing calls this directly

Calls 2

run_functionMethod · 0.95
writeMethod · 0.45

Tested by

no test coverage detected