Timeline



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`

Jan 30, 2019:

8:16 PM Changeset [1766:eae3caeeb146]default by Stefan Schwarzer <sschwarzer@…>
Use `twine` to upload package to PyPI According to https://truveris.github.io/articles/configuring-pypirc/ , twine uses the `~/.pypirc` configuration file. Note, however, that the section `server-login` is no longer used. Instead, username and password go in the `[pypi]` section. Should the configuration file _not_ be picked up by twine, there's still the possibility of setting the environment variables `TWINE_USERNAME` and `TWINE_PASSWORD`. Of course, care must be taken so that they're only readable/usable by the owner of the PyPI account!
8:02 PM Changeset [1765:5d3932c657ca] by Stefan Schwarzer <sschwarzer@…>
Add TODO on `twine` usage
7:57 PM Changeset [1764:618a99c291d4] by Stefan Schwarzer <sschwarzer@…>
Emphasize missing Python 2 support even more
7:52 PM Changeset [1763:9439a6ed3795] by Stefan Schwarzer <sschwarzer@…>
Add check to prevent Python < 3.5 install Prevent installation with a helpful message before an incompatible pip/setuptools may encounter the `python_requires` keyword argument. See https://python3statement.org/practicalities .
7:28 PM Changeset [1762:d5ce348ec42f] by Stefan Schwarzer <sschwarzer@…>
Add `python_requires` argument to `setup` See https://python3statement.org/practicalities .

Jan 28, 2019:

9:07 PM Changeset [1761:23c1639ea0e5] by Stefan Schwarzer <sschwarzer@…>
Remove `ScriptedSession` from `__all__` `ScriptedSession` shouldn't be used directly. Instead use `factory` to create `ScriptedSession`s implicitly.
9:01 PM Changeset [1760:5eb6ef13362a] by Stefan Schwarzer <sschwarzer@…>
Implement the multi-script factory more clearly Use a class `MultisessionFactory` with a `__call__` method to return consecutive factories that will use the respective scripts from the constructor argument `scripts`. See also the docstring of `MultisessionFactory` for an example.
8:43 PM Changeset [1759:e207929eef6c] by Stefan Schwarzer <sschwarzer@…>
Generalize session factory creation Allow more than one script in the `factory` function. For each script in `scripts`, a new `ScriptedSession` with the corresponding `script` will be used when the factory is called by `FTPHost._make_session`. The implementation seems to work fine, but it's even more difficult to understand than the previous version. I'm considering implementing this with a class.
8:21 PM Changeset [1758:ebd10c7d0d1f] by Stefan Schwarzer <sschwarzer@…>
Explain purpose of `init` call
7:45 PM Changeset [1757:480538e14451] by Stefan Schwarzer <sschwarzer@…>
Print when a session factory is called Print when a session factory is called, in other words, when a new `ScriptedSession` is instantiated. This is very helpful for tests that involve more than one `ScriptedSession` instance, e. g. tests for the download/upload functionality.
7:43 PM Changeset [1756:ad291ad87245] by Stefan Schwarzer <sschwarzer@…>
Prefix `print`s with `ScriptedSession` instance When printing from a `ScriptedSession` instance for tracking/debugging, prepend information on the respective `ScriptedSession` instance. Example: <ScriptedSession at 0x7ff1881a72e8> Expected method name: '__init__' This makes it much clearer what's going on if a test needs more than one `ScriptedSession`.
7:11 PM Changeset [1755:c7abe644763b] by Stefan Schwarzer <sschwarzer@…>
Comment `_index` instance variable
6:29 PM Ticket #116 (Deal with Pylint messages) closed by schwa
fixed: With the current Pylint configuration messages are manageable now. The …
6:16 PM Ticket #110 (Directory listings are empty if a server doesn't support the`-a` option) closed by schwa
fixed: This is changed in master (changeset [766c15f83205]).
Note: See TracTimeline for information about the timeline view.