Timeline



Jun 17, 2019:

10:24 PM Changeset [1810:840277a08296] by Stefan Schwarzer <sschwarzer@…>
Remove `ascii_data` This function is no longer needed. I assume this was used when we still had an "ASCII" mode that was about converting line endings on the fly. Since `random_data` now would only be needed in `binary_data`, merge `random_data` into `binary_data`.
10:18 PM Changeset [1809:03b28a125c97] by Stefan Schwarzer <sschwarzer@…>
Remove uses of `mock_ftplib` With all the test cases in `test_host.py` switched to the `scripted_session` module, `mock_ftplib` is no longer needed.
10:16 PM Changeset [1808:f1fa4cf11231] by Stefan Schwarzer <sschwarzer@…>
Use `ScriptedSession` in `TestFailingPickling`
10:09 PM Changeset [1807:65b79d35761d] by Stefan Schwarzer <sschwarzer@…>
Define `Call` on module level Create a reference `Call` to `scripted_session.Call` on the module level, so that not every test method has to create a local reference.
9:57 PM Changeset [1806:6a898515802d] by Stefan Schwarzer <sschwarzer@…>
Use `ScriptedSession` in `TestAcceptEitherUnicodeOrBytes` Only during working on this I became aware how many `cwd` calls happen for most of the FTP commands. This was kind of hidden with the previous implementation which faked the FTP server and didn't require any specification (or look at) the actually executed FTP/session commands.
5:29 PM Changeset [1805:afdbffb32f8d] by Stefan Schwarzer <sschwarzer@…>
Use `ScriptedSession` in `test_synchronize_times_for_server_in_east`
5:14 PM Changeset [1804:88d20a857d6d] by Stefan Schwarzer <sschwarzer@…>
Move helper class `_Path` Move helper mock class `_Path` to class level of `TestTimeShift` to make `_Path` usable for multiple test methods.

Jun 10, 2019:

10:55 PM Changeset [1803:555e10d7d302] by Stefan Schwarzer <sschwarzer@…>
Use `ScriptedSession` in `test_synchronize_times` We no longer use the `TimeShiftFTPHost` class here; instead put `_Path` helper class in the test method. However, `TimeShiftFTPHost` is still used in the following test method `test_synchronize_times_for_server_in_east`, so this needs some refactoring later.
10:17 PM Changeset [1802:cb4ed831f41e] by Stefan Schwarzer <sschwarzer@…>
Add another reason for race condition The more likely reason for a race condition would be removal of the helper file. All in all, that's still quite unlikely. ;-)
10:11 PM Changeset [1801:70f6c1457158] by Stefan Schwarzer <sschwarzer@…>
Use `ScriptedSession` in `test_assert_valid_time_shift`
10:08 PM Changeset [1800:f8e4a49b6c62] by Stefan Schwarzer <sschwarzer@…>
Use `ScriptedSession` in `test_rounded_time_shift`
9:59 PM Changeset [1799:7d0043ea6eb1] by Stefan Schwarzer <sschwarzer@…>
Use `ScriptedSession` in `test_conditional_download_with_newer_target`
9:48 PM Changeset [1798:d54db23b933b] by Stefan Schwarzer <sschwarzer@…>
Use `ScriptedSession` in `test_conditional_download_with_older_target`
9:38 PM Changeset [1797:25d9514b2cef] by Stefan Schwarzer <sschwarzer@…>
Use `ScriptedSession` for `test_conditional_download_without_target`
9:33 PM Changeset [1796:10014a3ee248] by Stefan Schwarzer <sschwarzer@…>
Distinguish sources of calls Don't only print the scripted session, but also whether the call is in `_next_script_call` or `__getattr__`.
5:04 PM Changeset [1795:26d05e101044] by Stefan Schwarzer <sschwarzer@…>
Use `ScriptedSession` in `test_conditional_upload_with_upload` This test requires two scripts, one for the host on which `upload_if_newer` is called and one for the session that is used for the actual file transfer. Since `unittest.mock.patch` can't patch the built-in code of `io.BytesIO` and `io.StringIO`, I added two trivial classes that _can_ be patched.
4:58 PM Changeset [1794:8352e0d49d69] by Stefan Schwarzer <sschwarzer@…>
Define allowed marker explicitly This is a feature in Pytest that should prevent unexpected behavior because of typos in marker names.

Jun 9, 2019:

8:42 PM Changeset [1793:82b72a77706d] by Stefan Schwarzer <sschwarzer@…>
Use `ScriptedSession` in `test_conditional_upload_without_upload`
8:40 PM Changeset [1792:a1e5112eb836] by Stefan Schwarzer <sschwarzer@…>
Move `local_target` assignment down We're copying from the remove file to the local target. Reflect this in the order of the statements.

Apr 22, 2019:

5:47 PM Changeset [1791:866a59de515d] by Stefan Schwarzer <sschwarzer@…>
Add `dir_line` function The function can be used to construct lines as they would be returned in an FTP listing. This is especially useful if we need to control the date or time relative to the current date or time.
5:34 PM Changeset [1790:5eccaa7bf8fe] by Stefan Schwarzer <sschwarzer@…>
Update class docstring We no longer distinguish ASCII and binary mode in the "FTP sense". It's still possible to open a remote file as text or binary, but uploads and downloads are always binary.
4:12 PM Changeset [1789:3133202c909c] by Stefan Schwarzer <sschwarzer@…>
Print `ScriptedSession` in only one place Print `ScriptedSession` in only one place, in `_next_script_call`. Escpecially, print the object before `_next_script_call` may raise an exception, so we have the information available for debugging.

Apr 21, 2019:

6:07 PM WikiDeletePage edited by trac
(diff)
6:07 PM TracNotification edited by trac
(diff)
6:07 PM TracBrowser edited by trac
(diff)
6:07 PM CamelCase edited by trac
(diff)
6:07 PM TracWiki edited by trac
(diff)
6:07 PM TicketQuery created by trac
6:07 PM TracQuery edited by trac
(diff)
6:07 PM TracPlugins edited by trac
(diff)
6:07 PM TracGuide edited by trac
(diff)
6:07 PM TracNavigation edited by trac
(diff)
6:07 PM TracBackup edited by trac
(diff)
6:07 PM WikiMacros edited by trac
(diff)
6:07 PM TracReports edited by trac
(diff)
6:07 PM TracUpgrade edited by trac
(diff)
6:07 PM TracAdmin edited by trac
(diff)
6:07 PM TracLogging edited by trac
(diff)
6:07 PM TracWorkflow edited by trac
(diff)
6:07 PM TracStandalone edited by trac
(diff)
6:07 PM InterWiki edited by trac
(diff)
6:07 PM TracLinks edited by trac
(diff)
6:07 PM TracRevisionLog edited by trac
(diff)
6:07 PM TracTimeline edited by trac
(diff)
6:07 PM InterTrac edited by trac
(diff)
6:07 PM WikiFormatting edited by trac
(diff)
6:07 PM TracRoadmap edited by trac
(diff)
6:07 PM WikiPageNames edited by trac
(diff)
6:07 PM TracModWSGI edited by trac
(diff)
6:07 PM PageTemplates edited by trac
(diff)
6:07 PM TracSupport edited by trac
(diff)
6:07 PM TracInstall edited by trac
(diff)
6:07 PM TracChangeset edited by trac
(diff)
6:07 PM WikiNewPage edited by trac
(diff)
6:07 PM WikiHtml edited by trac
(diff)
6:07 PM TracFastCgi edited by trac
(diff)
6:07 PM TracImport edited by trac
(diff)
6:07 PM TracModPython edited by trac
(diff)
6:07 PM TracEnvironment edited by trac
(diff)
6:07 PM TracTickets edited by trac
(diff)
6:07 PM TracIni edited by trac
(diff)
6:07 PM TracSyntaxColoring edited by trac
(diff)
6:07 PM TracAccessibility edited by trac
(diff)
6:07 PM TracRepositoryAdmin edited by trac
(diff)
6:07 PM TracSearch edited by trac
(diff)
6:07 PM TracPermissions edited by trac
(diff)
6:07 PM TracFineGrainedPermissions edited by trac
(diff)
6:07 PM TracTicketsCustomFields edited by trac
(diff)
6:07 PM WikiRestructuredText edited by trac
(diff)
6:07 PM TracRss edited by trac
(diff)
6:07 PM TracInterfaceCustomization edited by trac
(diff)
6:07 PM WikiProcessors edited by trac
(diff)
6:07 PM TracCgi edited by trac
(diff)
6:07 PM TracChangeLog created by trac
6:07 PM WikiRestructuredTextLinks edited by trac
(diff)
6:07 PM TracBatchModify edited by trac
(diff)
6:07 PM TracUnicode edited by trac
(diff)

Apr 20, 2019:

10:20 PM Changeset [1788:f793533cee54] by Stefan Schwarzer <sschwarzer@…>
Print requested attribute When running out of `Call` objects for a `ScriptedSession`, print the last requested attribute to give the test developer a hint about what kind of call is missing next.
9:50 PM Changeset [1787:ebfb895f1abb] by Stefan Schwarzer <sschwarzer@…>
Change `self._print` to `print` Since the `_print` method was removed, using it triggered a `__getattr__` call, which in turn triggered an `IndexError` and an attempted call to `_print` etc., leading to an infinite recursion.
9:35 PM Changeset [1786:6bf3f11c4eb1] by Stefan Schwarzer <sschwarzer@…>
Remove line that was added for a breakpoint
5:26 PM Changeset [1785:d9c22cc77a24] by Stefan Schwarzer <sschwarzer@…>
Remove `test_recursive_listing` Remove `TestRecursiveListingForDotAsPath.test_recursive_listing`. The method failed and after stepping through it with the debugger, it's not clear why it worked to begin with. Since this is anyway an obscure way to test the use of '.' vs. '' in the `session.dir` call I decided to remove the test.
5:23 PM Changeset [1784:be1e64b05a25] by Stefan Schwarzer <sschwarzer@…>
Combine call checks Combine most of `Call.check_method_name`, `Call.check_args`, `ScriptedSession._print_method_names` and `ScriptedSession._print_args` in `Call.check_args`. By printing the "ScriptedSession n" header separately instead of using it in all print calls, I was able to move the printing of methods and arguments into `Call`.

Apr 19, 2019:

9:52 PM Changeset [1783:2ae14d87d0ef] by Stefan Schwarzer <sschwarzer@…>
Reset session counter for each test Reset the class variable `_session_count` in `ScriptedSession` every time a `MultisessionFactory` object is created. In practice, this means that the counter is reset for each test. However, there could be a problem when we create more than one `MultisessionFactory` in a single test. I added an extra class method `reset_session_count` to hide whether "resetting" means to set `_session_count` to 0 or to 1.
9:42 PM Changeset [1782:866f74bb0220] by Stefan Schwarzer <sschwarzer@…>
Revise `scripted_session` module While adapting the test `TestUploadAndDownload.test_download` to the scripted session concept, I got pretty confused about the "scripted" call vs. the call from the system under test. Especially the term "expected" turned out to be confusing: - "Expected" can mean we specified something in the scripted call, and we expect the system under test to behave accordingly. This is the original notion I had when using "expected". - However, when creating tests, it can happen that the scripted call is specified wrongly and the "expected" call is the one from the system under test, not from the scripted call. Therefore, I decided to remove the word "expected" from the API and speak of `scripted_*` vs. `sut_*`. Apart from this naming change, I refactored the printing and checking of method names, args and kwargs of scripted call vs. sut call. A disadvantage of the new design is that the method name check must now be called explicitly from every method in `ScriptedSession` that could be called by the system under test. This isn't just the `__getattr__` method, but also `dir`, `transfercmd` and `ntransfercmd`. Maybe I can fix or improve this later.
6:31 PM Changeset [1781:88ac92027072] by Stefan Schwarzer <sschwarzer@…>
Fix mock socket assertions - I forgot to explicitly use `assert` for the comparisons. This is a common mistake because mock's `assert_*` methods have the assertion built in whereas other mock checks require an explicit `assert` statement. Although it's clear when an explicit `assert` is needed, it's easy to forget. - Fix comparison tuples for `call` objects. The wrong comparison values weren't noticed before because of the previous bullet point. Despite the examples in the documentation, it's somewhat difficult to see what the comparison values should be. A big help is to use `tuple(call)` on an expected `call` to see what the comparison tuple should look like.
6:20 PM Changeset [1780:8e0cb12054ea] by Stefan Schwarzer <sschwarzer@…>
Use named constant from `FTPFile` Use named constant `FTPFile._close_timeout` instead of literal 5.
6:18 PM Changeset [1779:554879f6050a] by Stefan Schwarzer <sschwarzer@…>
Turn `_scripted_sessions` into a public attribute
6:16 PM Changeset [1778:a25fab65d6b1] by Stefan Schwarzer <sschwarzer@…>
Verify operations on mock socket
6:15 PM Changeset [1777:54ec3c0fbe70] by Stefan Schwarzer <sschwarzer@…>
Remember created `ScriptedSession` objects These can be examined after running a test.
5:51 PM Changeset [1776:de2dec8839fa] by Stefan Schwarzer <sschwarzer@…>
Use `ScriptedSession` in `test_download` This also requires some additions to the `ScriptedSession` class, namely a `sock` attribute and the `ntransfercmd` and `transfercmd` methods. This test is the first to use more than one `ScriptedSession` object. One object is for the initially created `host` object, the other for the FTP file.
5:06 PM Changeset [1775:3aa4a955ed66] by Stefan Schwarzer <sschwarzer@…>
Structure output with some indentation
4:44 PM Changeset [1774:cdafd091b9d1] by Stefan Schwarzer <sschwarzer@…>
Rename `_index` to `_call_index` This makes it easier to understand and to distinguish it from `_session_count`.
4:41 PM Changeset [1773:9bec86daea2d] by Stefan Schwarzer <sschwarzer@…>
Revise `ScriptedSession` debugging output - Avoid continuation after using `end=""`. Instead, don't use the `end` argument, even if it means printing one more line. - Print a proper error message if we run out of `Call` objects instead of only showing _only_ an `IndexError`.
4:22 PM Changeset [1772:172c44d9b83c] by Stefan Schwarzer <sschwarzer@…>
Fix confusing code Show explicitly what's going on. The previous statement self._session_count = self._session_count looked really weird although it did something sensible: copying the current class-level counter to an instance variable.
4:16 PM Changeset [1771:cd4643cb9969] by Stefan Schwarzer <sschwarzer@…>
Shorten `ScriptedSession` tag in output Instead of printing <ScriptedSession at 0x7f45f5aaa780> Expecting method name '__init__' - found it print a shorter form ScriptedSession 1: Expecting method name '__init__' - found it `ScriptedSession`s get increasing counter values (which is a class-level variable). This makes the output not only more compact, but also makes it easier to distinguish different `ScriptedSession` objects. Of course, this wouldn't work properly with multithreaded or multiprocessing code, but I don't see a need for this anytime soon.
4:09 PM Changeset [1770:6027514990a8] by Stefan Schwarzer <sschwarzer@…>
Insert section comment Insert section comment to separate custom `ftplib.FTP` methods.
4:04 PM Changeset [1769:22c600474048] by Stefan Schwarzer <sschwarzer@…>
Improve `ScriptedSession` output Make it easier to follow what's going on while selecting and processing each call.
3:02 PM Changeset [1768:f0c8711b57d5] by Stefan Schwarzer <sschwarzer@…>
Explain why we don't override `__repr__`
2:51 PM Changeset [1767:eab86b88e8ea] by Stefan Schwarzer <sschwarzer@…>
Add docstring for `Call.check_args`
Note: See TracTimeline for information about the timeline view.