-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move more processing out of main function
- Loading branch information
Showing
6 changed files
with
99 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[behave] | ||
paths = src/abaqus2dyna/test/features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Feature: full test | ||
|
||
Scenario: example.inp | ||
Given example.inp | ||
When we convert it | ||
Then we expect an output file with 69722 lines | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import io | ||
|
||
from behave import given, then, when | ||
|
||
import abaqus2dyna.__main__ | ||
|
||
@given('{filename}') | ||
def step_impl(context, filename): | ||
context.name = filename | ||
|
||
@when("we convert it") | ||
def step_impl(context): | ||
context.out = io.StringIO() | ||
with open(context.name) as fin: | ||
abaqus2dyna.__main__.convert(fin, context.out) | ||
|
||
@then('we expect an output file with {number:d} lines') | ||
def step_impl(context, number): | ||
context.out.seek(0) | ||
print(len(context.out.read().splitlines())) | ||
context.out.seek(0) | ||
assert len(context.out.read().splitlines()) == number | ||
|