| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Done. Thanks! Edited: btw, we've got tested like this: class TestUUIDWithoutExtModule(BaseTestUUID, unittest.TestCase):
uuid = py_uuidIn this current PR code, this test in redundant. I suggest maybe we could combine them together (?) |
Sorry, something went wrong.
| self.assertIs(strong, weak()) | ||
|
|
||
|
|
||
| class TestUUIDCli(BaseTestUUID, unittest.TestCase): |
There was a problem hiding this comment.
Do we need all CAPS on term CLI?
Sorry, something went wrong.
There was a problem hiding this comment.
Just check how other classes testing CLIs are named.
Sorry, something went wrong.
There was a problem hiding this comment.
There is a lot of duplicated code. I would sugfgest having a single a single function that tests the expected outputs accordingly:
def do_test_standalone_uuid(self, version):
stdout = io.StringIO()
with contextlib.redirect_stdout(stdout):
self.uuid.main()
output = stdout.getvalue().strip()
u = self.uuid.UUID(output)
self.assertEqual(output, str(u))
self.assertEqual(u.version, version)
@mock.patch.object(sys, "argv", ["", "-u", "uuid1"])
def test_uuid1(self):
self.do_test_standalone_uuid(1)and similar stuff for v6, v7 and v8.
Sorry, something went wrong.
In the test case of cli we've actually already tested UUID without ext moudle (?, I'm not quiet sure) So maybe combining them together will be better? |
Sorry, something went wrong.
| self.assertIs(strong, weak()) | ||
|
|
||
|
|
||
| class TestUUIDCli(BaseTestUUID, unittest.TestCase): |
There was a problem hiding this comment.
Just check how other classes testing CLIs are named.
Sorry, something went wrong.
It's not entirely redundant. However I see the issue. Two possibilities:
Or:
|
Sorry, something went wrong.
|
Ok, actually CommandLineTest is a more common name in the code base. Just use it, no need to mention UUID (search for "CommandLineTest" and you'll see) |
Sorry, something went wrong.
The test classes before are named in testUUID* (which I think would be better if we add this prefix in this func). But yes CommandLineTest only is more common one in the code base so it's OK. |
Sorry, something went wrong.
This is better IMO. I've changed it. |
Sorry, something went wrong.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
Thanks! Should we backport this to 3.14? The new UUIDs are added in that version |
Sorry, something went wrong.
|
Thanks @LamentXU123 for the PR, and @picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
(cherry picked from commit c564847) Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
GH-136576 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
) (python#136576) pythongh-89083: Add CLI tests for `UUIDv{6,7,8}` (pythonGH-136548) (cherry picked from commit c564847) Co-authored-by: Weilin Du <108666168+LamentXU123@users.noreply.github.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
This PR add simple cli test cases to UUIDv6, v7, v8 added in #89083 , as well as a test case to UUID v1.
There are only one test cases for each, since they can't be customized through CLI.
Skipping news ;)