p4cmd 2.10.1__tar.gz → 2.10.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {p4cmd-2.10.1 → p4cmd-2.10.2}/PKG-INFO +1 -1
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/__init__.py +1 -1
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/p4cmd.py +1 -1
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd.egg-info/PKG-INFO +1 -1
- {p4cmd-2.10.1 → p4cmd-2.10.2}/tests/test_p4client.py +18 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/LICENSE +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/README.md +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/p4errors.py +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/p4file.py +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/__init__.py +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_DEPOT_ONLY.png +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_MOVED.png +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_NEED_SYNC.png +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_OPEN_FOR_ADD.png +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_OPEN_FOR_DELETE.png +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_OPEN_FOR_EDIT.png +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_UNKNOWN.png +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_UNTRACKED.png +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_UP_TO_DATE.png +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/utils.py +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd.egg-info/SOURCES.txt +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd.egg-info/dependency_links.txt +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd.egg-info/requires.txt +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd.egg-info/top_level.txt +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/setup.cfg +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/setup.py +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/tests/__init__.py +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/tests/conftest.py +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/tests/test_integration.py +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/tests/test_p4file.py +0 -0
- {p4cmd-2.10.1 → p4cmd-2.10.2}/tests/test_utils.py +0 -0
|
@@ -138,7 +138,7 @@ class P4Client(object):
|
|
|
138
138
|
except ValueError as error:
|
|
139
139
|
output_dict = {
|
|
140
140
|
"command": command,
|
|
141
|
-
"code": "
|
|
141
|
+
"code": "raw",
|
|
142
142
|
"error": str(error),
|
|
143
143
|
"raw_output": subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True, cwd=self.perforce_root)
|
|
144
144
|
}
|
|
@@ -667,6 +667,24 @@ def test_run_cmd_handles_string_key_error_dicts(p4client, caplog):
|
|
|
667
667
|
assert "some error" in caplog.text
|
|
668
668
|
|
|
669
669
|
|
|
670
|
+
def test_run_cmd_value_error_fallback_no_warning(p4client, caplog):
|
|
671
|
+
"""run_cmd's ValueError fallback (e.g. `p4 set`) must not log spurious error warnings."""
|
|
672
|
+
with patch("subprocess.Popen") as mock_popen, \
|
|
673
|
+
patch("p4cmd.p4cmd.subprocess.check_output", return_value=b"P4USER=niels.vaes (set)\n"):
|
|
674
|
+
# Empty stdout triggers ValueError on marshal.load (unknown type code in this case
|
|
675
|
+
# would also work; here we use bytes that aren't valid marshal data).
|
|
676
|
+
import io as _io
|
|
677
|
+
buf = _io.BytesIO(b"\xff\xff\xff\xff") # invalid marshal type code -> ValueError
|
|
678
|
+
mock_popen.return_value.__enter__ = lambda s: s
|
|
679
|
+
mock_popen.return_value.__exit__ = MagicMock(return_value=False)
|
|
680
|
+
mock_popen.return_value.stdout = buf
|
|
681
|
+
mock_popen.return_value.kill = MagicMock()
|
|
682
|
+
with caplog.at_level(logging.WARNING):
|
|
683
|
+
result = p4client.get_p4_setting("P4USER")
|
|
684
|
+
assert result == "niels.vaes"
|
|
685
|
+
assert caplog.records == []
|
|
686
|
+
|
|
687
|
+
|
|
670
688
|
def test_get_local_paths_missing_path(p4client):
|
|
671
689
|
"""get_local_paths skips entries where path is missing (e.g. unmapped paths from p4 where)."""
|
|
672
690
|
info_dicts = [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|