Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I need the app I am testing to read command line switches and options #1121

Closed
FriesK1 opened this issue Jul 28, 2023 · 2 comments
Closed

I need the app I am testing to read command line switches and options #1121

FriesK1 opened this issue Jul 28, 2023 · 2 comments
Labels

Comments

@FriesK1
Copy link

FriesK1 commented Jul 28, 2023

I am writing a library that will handle our configuration management. Part of what I need to test is setting those options from the command line... its a standard part of input for this library and critical for a properly tested package. So is there a mechanism to send command line switches not to behave, but to the package behave is testing? This is a pretty critical piece of testing for most programs I write.

@bittner
Copy link
Member

bittner commented Jul 28, 2023

Can you describe the way you'd like to use Behave to test the CLI behavior of your application?

It really depends on that. Behave is just a test runner. How you implement your tests is a different story.

For example, you may want to take a look at cli-test-helpers for ready-to-use test setups if you're fine to run unit tests. You can use the ideas to test a CLI from there too, and use (nearly) the same test code in your step implementations, if you prefer to stick to Behave.

@jenisys
Copy link
Member

jenisys commented Jul 30, 2023

@FriesK1

  • Have you looked at behave4cmd0 and its step-library (bundled with behave) ?
  • There are some similar behave step-libraries for command-process on https://pypi.org/ (AFAIK).
    HINT: Just search for behave .

SEE ALSO:

NOTES:

  • Questions are normally asked under discussions and not under issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants