Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CICD 2022
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bilel El Yaagoubi
CICD 2022
Commits
ea23c88a
Commit
ea23c88a
authored
Oct 12, 2022
by
Bilel El Yaagoubi
Browse files
Options
Downloads
Patches
Plain Diff
fix lint
parent
4e5179c4
No related branches found
No related tags found
No related merge requests found
Pipeline
#46220
passed
Oct 12, 2022
Stage: dependencies
Stage: lint
Stage: test
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
calculator/calculator.py
+1
-1
1 addition, 1 deletion
calculator/calculator.py
calculator/test_calculator.py
+4
-1
4 additions, 1 deletion
calculator/test_calculator.py
with
5 additions
and
2 deletions
calculator/calculator.py
+
1
−
1
View file @
ea23c88a
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
This Calculator holds the logic for the calculator.
This Calculator holds the logic for the calculator.
"""
"""
from
calculator.operators
import
Operator
,
STANDARD_OPERATORS
from
calculator.operators
import
Operator
,
STANDARD_OPERATORS
from
calculator.expression
import
Token
,
Term
,
Expression
,
TermExpression
,
OperatorExpression
from
calculator.expression
import
Term
,
Expression
,
TermExpression
,
OperatorExpression
class
Calculator
:
class
Calculator
:
...
...
This diff is collapsed.
Click to expand it.
calculator/test_calculator.py
+
4
−
1
View file @
ea23c88a
...
@@ -3,7 +3,7 @@ Test module for the calculator module.
...
@@ -3,7 +3,7 @@ Test module for the calculator module.
"""
"""
import
pytest
import
pytest
from
calculator.calculator
import
Calculator
from
calculator.calculator
import
Calculator
from
calculator.operators
import
STANDARD_OPERATORS
,
Operator
from
calculator.operators
import
STANDARD_OPERATORS
@pytest.fixture
(
scope
=
"
module
"
,
name
=
"
setup
"
)
@pytest.fixture
(
scope
=
"
module
"
,
name
=
"
setup
"
)
...
@@ -21,6 +21,9 @@ def fixture_setup():
...
@@ -21,6 +21,9 @@ def fixture_setup():
def
test_tokenizer
(
setup
):
def
test_tokenizer
(
setup
):
"""
Setup the test suite, by instantiating the calculator and the operators.
"""
plus
,
minus
,
times
,
divide
,
calc
=
setup
plus
,
minus
,
times
,
divide
,
calc
=
setup
assert
calc
.
tokenize
(
"
1 + 2 + 4 / 2
"
)
==
[
1
,
plus
,
2
,
plus
,
4
,
divide
,
2
]
assert
calc
.
tokenize
(
"
1 + 2 + 4 / 2
"
)
==
[
1
,
plus
,
2
,
plus
,
4
,
divide
,
2
]
assert
calc
.
tokenize
(
"
1 * 0 - 4 / 2
"
)
==
[
1
,
times
,
0
,
minus
,
4
,
divide
,
2
]
assert
calc
.
tokenize
(
"
1 * 0 - 4 / 2
"
)
==
[
1
,
times
,
0
,
minus
,
4
,
divide
,
2
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment