Ejemplo n.º 1
0
 def falls_back_to_defaultlocale_when_preferredencoding_is_None(self):
     if not six.PY3:
         skip()
     with patch('invoke.runners.locale') as fake_locale:
         fake_locale.getdefaultlocale.return_value = (None, None)
         fake_locale.getpreferredencoding.return_value = 'FALLBACK'
         eq_(self._runner().default_encoding(), 'FALLBACK')
Ejemplo n.º 2
0
 def bool_implies_default_False_not_None(self):
     # Right now, parsing a bool flag not given results in None
     # TODO: may want more nuance here -- False when a --no-XXX flag is
     # given, True if --XXX, None if not seen?
     # Only makes sense if we add automatic --no-XXX stuff (think
     # ./configure)
     skip()
Ejemplo n.º 3
0
 def stdin_mirroring_isnt_cpu_heavy(self):
     "stdin mirroring isn't CPU-heavy"
     # CPU measurement under PyPy is...rather different. NBD.
     if PYPY:
         skip()
     with assert_cpu_usage(lt=5.0):
         run("python -u busywork.py 10", pty=True, hide=True)
Ejemplo n.º 4
0
 def bool_implies_default_False_not_None(self):
     # Right now, parsing a bool flag not given results in None
     # TODO: may want more nuance here -- False when a --no-XXX flag is
     # given, True if --XXX, None if not seen?
     # Only makes sense if we add automatic --no-XXX stuff (think
     # ./configure)
     skip()
Ejemplo n.º 5
0
 def falls_back_to_defaultlocale_when_preferredencoding_is_None(self):
     if PY2:
         skip()
     with patch('invoke.runners.locale') as fake_locale:
         fake_locale.getdefaultlocale.return_value = (None, None)
         fake_locale.getpreferredencoding.return_value = 'FALLBACK'
         eq_(self._runner().default_encoding(), 'FALLBACK')
Ejemplo n.º 6
0
 def isnt_cpu_heavy(self):
     "stdin mirroring isn't CPU-heavy"
     # CPU measurement under PyPy is...rather different. NBD.
     if PYPY:
         skip()
     with assert_cpu_usage(lt=5.0):
         run("python -u busywork.py 10", pty=True, hide=True)
Ejemplo n.º 7
0
 def isnt_cpu_heavy(self):
     "stdin mirroring isn't CPU-heavy"
     # CPU measurement under PyPy is...rather different. NBD.
     if PYPY:
         skip()
     # Python 3.5 has been seen using up to ~6.0s CPU time under Travis
     with assert_cpu_usage(lt=7.0):
         run("python -u busywork.py 10", pty=True, hide=True)
Ejemplo n.º 8
0
 def invocable_via_python_dash_m(self):
     # TODO: replace with pytest marker after pytest port
     if sys.version_info < (2, 7):
         skip()
     _output_eq(
         "python -m invoke print_name --name mainline",
         "mainline\n",
     )
Ejemplo n.º 9
0
 def isnt_cpu_heavy(self):
     "stdin mirroring isn't CPU-heavy"
     # CPU measurement under PyPy is...rather different. NBD.
     if PYPY:
         skip()
     # Python 3.5 has been seen using up to ~6.0s CPU time under Travis
     with assert_cpu_usage(lt=7.0):
         run("python -u busywork.py 10", pty=True, hide=True)
Ejemplo n.º 10
0
 def invocable_via_python_dash_m(self):
     # TODO: replace with pytest marker after pytest port
     if sys.version_info < (2, 7):
         skip()
     _output_eq(
         "python -m invoke print-name --name mainline",
         "mainline\n",
     )
Ejemplo n.º 11
0
 def echo_hides_extra_sudo_flags(self):
     skip() # see TODO in sudo() re: clean output display
     config = Config(overrides={'runner': _Dummy})
     Context(config=config).sudo('nope', echo=True)
     output = sys.stdout.getvalue()
     sys.__stderr__.write(repr(output) + "\n")
     ok_("-S" not in output)
     ok_(Context().sudo.prompt not in output)
     ok_("sudo nope" in output)
Ejemplo n.º 12
0
 def echo_hides_extra_sudo_flags(self):
     skip() # see TODO in sudo() re: clean output display
     config = Config(overrides={'runner': _Dummy})
     Context(config=config).sudo('nope', echo=True)
     output = sys.stdout.getvalue()
     sys.__stderr__.write(repr(output) + "\n")
     ok_("-S" not in output)
     ok_(Context().sudo.prompt not in output)
     ok_("sudo nope" in output)
Ejemplo n.º 13
0
 def base_case(self):
     # NOTE: Assumes a user whose password is 'mypass' has been created
     # & added to passworded (not passwordless) sudo configuration; and
     # that this user is the one running the test suite. Only for
     # running on Travis, basically.
     if not os.environ.get('TRAVIS', False):
         skip()
     config = Config(overrides={'sudo': {'password': '******'}})
     result = Context(config=config).sudo('whoami', hide=True)
     eq_(result.stdout.strip(), 'root')
Ejemplo n.º 14
0
 def both_technically_okay(self):
     skip() # see TODO below
     _expect_actions(self,
         # TODO: display a 'warning' state noting that your
         # version outpaces your changelog despite your
         # changelog having no unreleased stuff in it. Still
         # "Okay" (no action needed), not an error per se, but
         # still "strange".
         Changelog.OKAY,
         VersionFile.OKAY,
     )
Ejemplo n.º 15
0
 def both_technically_okay(self):
     skip()  # see TODO below
     _expect_actions(
         self,
         # TODO: display a 'warning' state noting that your
         # version outpaces your changelog despite your
         # changelog having no unreleased stuff in it. Still
         # "Okay" (no action needed), not an error per se, but
         # still "strange".
         Changelog.OKAY,
         VersionFile.OKAY,
     )
Ejemplo n.º 16
0
 def manual_threading_works_okay(self):
     # TODO: needs https://github.com/pyinvoke/invoke/issues/438 fixed
     # before it will reliably pass
     skip()
     # Kind of silly but a nice base case for "how would someone thread this
     # stuff; and are there any bizarre gotchas lurking in default
     # config/context/connection state?"
     # Specifically, cut up the local (usually 100k's long) words dict into
     # per-thread chunks, then read those chunks via shell command, as a
     # crummy "make sure each thread isn't polluting things like stored
     # stdout" sanity test
     queue = Queue()
     # TODO: skip test on Windows or find suitable alternative file
     with codecs.open(_words, encoding='utf-8') as fd:
         data = [x.strip() for x in fd.readlines()]
     threads = []
     num_words = len(data)
     chunksize = len(data) / len(self.cxns)  # will be an int, which is fine
     for i, cxn in enumerate(self.cxns):
         start = i * chunksize
         end = max([start + chunksize, num_words])
         chunk = data[start:end]
         kwargs = dict(
             queue=queue,
             cxn=cxn,
             start=start,
             num_words=num_words,
             count=len(chunk),
             expected=chunk,
         )
         thread = ExceptionHandlingThread(target=_worker, kwargs=kwargs)
         threads.append(thread)
     for t in threads:
         t.start()
     for t in threads:
         t.join(5)  # Kinda slow, but hey, maybe the test runner is hot
     while not queue.empty():
         cxn, result, expected = queue.get(block=False)
         for resultword, expectedword in zip_longest(result, expected):
             err = u"({2!r}, {3!r}->{4!r}) {0!r} != {1!r}".format(
                 resultword,
                 expectedword,
                 cxn,
                 expected[0],
                 expected[-1],
             )
             assert resultword == expectedword, err
Ejemplo n.º 17
0
 def manual_threading_works_okay(self):
     # TODO: needs https://github.com/pyinvoke/invoke/issues/438 fixed
     # before it will reliably pass
     skip()
     # Kind of silly but a nice base case for "how would someone thread this
     # stuff; and are there any bizarre gotchas lurking in default
     # config/context/connection state?"
     # Specifically, cut up the local (usually 100k's long) words dict into
     # per-thread chunks, then read those chunks via shell command, as a
     # crummy "make sure each thread isn't polluting things like stored
     # stdout" sanity test
     queue = Queue()
     # TODO: skip test on Windows or find suitable alternative file
     with codecs.open(_words, encoding='utf-8') as fd:
         data = [x.strip() for x in fd.readlines()]
     threads = []
     num_words = len(data)
     chunksize = len(data) / len(self.cxns) # will be an int, which is fine
     for i, cxn in enumerate(self.cxns):
         start = i * chunksize
         end = max([start + chunksize, num_words])
         chunk = data[start:end]
         kwargs = dict(
             queue=queue,
             cxn=cxn,
             start=start,
             num_words=num_words,
             count=len(chunk),
             expected=chunk,
         )
         thread = ExceptionHandlingThread(target=_worker, kwargs=kwargs)
         threads.append(thread)
     for t in threads:
         t.start()
     for t in threads:
         t.join(5) # Kinda slow, but hey, maybe the test runner is hot
     while not queue.empty():
         cxn, result, expected = queue.get(block=False)
         for resultword, expectedword in zip_longest(result, expected):
             err = u"({2!r}, {3!r}->{4!r}) {0!r} != {1!r}".format(
                 resultword, expectedword, cxn, expected[0], expected[-1],
             )
             assert resultword == expectedword, err
Ejemplo n.º 18
0
 def inner(*args, **kwargs):
     if getattr(sys.stdout, 'encoding', None) == 'UTF-8':
         return f(*args, **kwargs)
     # TODO: could remove this so they show green, but figure yellow is more
     # appropriate
     skip()
Ejemplo n.º 19
0
 def wrapper(*args, **kwargs):
     if WINDOWS:
         skip()
     return fn(*args, **kwargs)
Ejemplo n.º 20
0
 def sets_arg_kind(self):
     skip()
Ejemplo n.º 21
0
 def iter(self):
     "__iter__"
     skip()
Ejemplo n.º 22
0
 def honors_kwarg(self):
     skip()
Ejemplo n.º 23
0
 def load_failure(self):
     skip()
Ejemplo n.º 24
0
 def keys(self):
     skip()
Ejemplo n.º 25
0
 def explicit_unstable_releases_still_eat_their_issues(self):
     # I.e. an 0.x.y releases using explicit issue listings, works
     # correctly - the explicitly listed issues don't appear in nearby
     # implicit releases.
     skip()
Ejemplo n.º 26
0
 def wrapper(*args, **kwargs):
     if WINDOWS:
         skip()
     return fn(*args, **kwargs)
Ejemplo n.º 27
0
 def semver_double_ended_specs_work_when_more_than_two_major_versions(self):
     skip()
Ejemplo n.º 28
0
 def can_disable_default_pin_to_latest_major_version(self):
     skip()
Ejemplo n.º 29
0
 def no_dedupe(self):
     skip()
Ejemplo n.º 30
0
 def list_(self):
     skip()
Ejemplo n.º 31
0
 def task_has_h_shortflag_throws_error(self):
     # def mytask(c, height):
     # inv mytask -h
     skip()
Ejemplo n.º 32
0
 def warning_only_fires_once(self):
     # I.e. if implementation checks pty-ness >1 time, only one warning
     # is emitted. This is kinda implementation-specific, but...
     skip()
Ejemplo n.º 33
0
 def adds_collection_as_subcollection_of_self(self):
     skip()
Ejemplo n.º 34
0
 def should_show_core_usage_on_core_failures(self):
     skip()
Ejemplo n.º 35
0
 def finds_subcollection_tasks_by_dotted_name(self):
     skip()
Ejemplo n.º 36
0
 def contents_of_dicts_are_distinct(self):
     skip()
Ejemplo n.º 37
0
 def honors_subcollection_aliases(self):
     skip()
Ejemplo n.º 38
0
 def values(self):
     skip()
Ejemplo n.º 39
0
 def is_None_for_custom_command_exits(self):
     # TODO: when we implement 'exitcodes 1 and 2 are actually OK'
     skip()
Ejemplo n.º 40
0
 def warning_only_fires_once(self):
     # I.e. if implementation checks pty-ness >1 time, only one warning
     # is emitted. This is kinda implementation-specific, but...
     skip()
Ejemplo n.º 41
0
 def should_show_context_usage_on_context_failures(self):
     skip()
Ejemplo n.º 42
0
 def is_aliased_to_dunder_getitem(self):
     "is aliased to __getitem__"
     skip()
Ejemplo n.º 43
0
 def prompt_value_is_properly_shell_escaped(self):
     # I.e. setting it to "here's johnny!" doesn't explode.
     # NOTE: possibly best to tie into issue #2
     skip()
Ejemplo n.º 44
0
 def should_show_core_usage_on_core_failures(self):
     skip()
Ejemplo n.º 45
0
 def kind_to_placeholder_map(self):
     # str=STRING, int=INT, etc etc
     skip()
Ejemplo n.º 46
0
 def load_failure(self):
     skip()
Ejemplo n.º 47
0
 def KeyboardInterrupt_on_stdin_doesnt_flake(self):
     # E.g. inv test => Ctrl-C halfway => shouldn't get buffer API errors
     skip()
Ejemplo n.º 48
0
 def KeyboardInterrupt_on_stdin_doesnt_flake(self):
     # E.g. inv test => Ctrl-C halfway => shouldn't get buffer API errors
     skip()
Ejemplo n.º 49
0
 def returns_copy_of_self(self):
     skip()
Ejemplo n.º 50
0
 def honors_kwarg(self):
     skip()
Ejemplo n.º 51
0
 def returns_FIONREAD_result_when_stream_is_a_tty(self):
     skip()
Ejemplo n.º 52
0
 def sets_arg_kind(self):
     skip()
Ejemplo n.º 53
0
 def returns_1_on_windows(self):
     skip()
Ejemplo n.º 54
0
 def should_show_context_usage_on_context_failures(self):
     skip()
Ejemplo n.º 55
0
 def kind_to_placeholder_map(self):
     # str=STRING, int=INT, etc etc
     skip()
Ejemplo n.º 56
0
 def non_stupid_OSErrors_get_captured(self):
     # Somehow trigger an OSError saying "Input/output error" within
     # pexpect.spawn().interact() & assert it is in result.exception
     skip()
Ejemplo n.º 57
0
 def with_post_tasks(self):
     skip()
Ejemplo n.º 58
0
 def honors_subcollection_default_tasks_on_subcollection_name(self):
     skip()
Ejemplo n.º 59
0
 def non_stupid_OSErrors_get_captured(self):
     # Somehow trigger an OSError saying "Input/output error" within
     # pexpect.spawn().interact() & assert it is in result.exception
     skip()