GithubHelp home page GithubHelp logo

Comments (6)

gouyang avatar gouyang commented on July 22, 2024

however it works with below method in other test case, don't know what the difference:
dkrcmd = DockerCmd(self, 'rm', [self.stuff['container_name']])
dkrcmd.execute()

from autotest-docker.

cevich avatar cevich commented on July 22, 2024

This is a python-language "feature" where strings are iterable sequences of characters. In other words, containing the string inside a list is key, so:

[self.stuff['container_name']] vs. self.stuff['container_name']

Both satisfy the "iterable" condition, and because "duck-typing" is used, see http://en.wikipedia.org/wiki/Duck_typing both are accepted as an "iterable". Here's the docstring (which I see is not properly rendered into documentation): https://github.com/autotest/autotest-docker/blob/master/dockertest/dockercmd.py#L29

BTW: I have run into this exact same problem before. Since you've now hit it, it must be more common than I assumed. I'm open if you @ouyanggh have ideas, but I think there are at least two simple solutions here:

  1. Move the __init__() docstring into the main class docstring so the parameter docs show up in the documentation (oops).
  2. Add a warning message if subargs is found to be string-like.

from autotest-docker.

cevich avatar cevich commented on July 22, 2024

Here's where the parameter docs are not rendering properly, it's an issue across all of our code with a cut-paste fix:
http://docker-autotest.readthedocs.org/en/latest/#dockertest.dockercmd.DockerCmdBase

@Lorquas would you mind looking into #1 and #2 above (and any additional ideas you have) for the dockercmd module?

@jzupka Could you help fix the same documentation (#1) problem in the images and container modules?

@ldoktor Could you help fix docker_daemon, networking and subtest?

I'll pick up the remaining modules. Let me know if anyone has questions.

from autotest-docker.

cevich avatar cevich commented on July 22, 2024

Documentation fix PR: #100

from autotest-docker.

gouyang avatar gouyang commented on July 22, 2024

I will use it in a list so far.

from autotest-docker.

cevich avatar cevich commented on July 22, 2024

Closing this since fix is in
#100

from autotest-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.