mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 01:16:14 +00:00
ci: fix test
This commit is contained in:
@@ -11,7 +11,6 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up python
|
||||
id: setup-python
|
||||
uses: actions/setup-python@v2
|
||||
@@ -21,6 +20,7 @@ jobs:
|
||||
uses: snok/install-poetry@v1
|
||||
with:
|
||||
virtualenvs-in-project: true
|
||||
- uses: actions/checkout@v2
|
||||
- name: Load cached venv
|
||||
id: cached-poetry-dependencies
|
||||
uses: actions/cache@v2
|
||||
@@ -40,6 +40,7 @@ jobs:
|
||||
run: |
|
||||
echo Test
|
||||
source .venv/bin/activate
|
||||
coverage run -m unittest || exit 1
|
||||
coverage run -m unittest || exit 11
|
||||
coverage combine
|
||||
coverage report
|
||||
[ -n "$CODACY_PROJECT_TOKEN" ] && coverage combine && coverage xml -o cobertura.xml && bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r cobertura.xml
|
||||
[ -n "$CODACY_PROJECT_TOKEN" ] && coverage xml -o cobertura.xml && bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r cobertura.xml
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
# Developer Information
|
||||
## Contributing
|
||||
## Contributing
|
||||
|
||||
Before create a pull request check your code with Prospector.
|
||||
Before creating a pull request check your code with Prospector.
|
||||
You can install it with
|
||||
|
||||
```
|
||||
poetry install --no-root```
|
||||
poetry install --no-root
|
||||
#Then in the root of the git project:
|
||||
prospector
|
||||
```
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
[General]
|
||||
currency = €
|
||||
|
||||
[Electricity config]
|
||||
day price = 0.1853
|
||||
night price = 0.1353
|
||||
night hour start = 22h30
|
||||
night hour end = 6h00
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"abrp": {
|
||||
"token": null
|
||||
},
|
||||
"client_id": "cid",
|
||||
"client_secret": "csec",
|
||||
"co2_signal_api": null,
|
||||
"country_code": "FR",
|
||||
"customer_id": "AP-ACNT1234",
|
||||
"proxies": null,
|
||||
"realm": "clientsB2CPeugeot",
|
||||
"refresh_token": "aasds-aaa",
|
||||
"remote_refresh_token": "aa",
|
||||
"weather_api": null
|
||||
}
|
||||
@@ -22,20 +22,22 @@ from psa_car_controller.psacc.application.charge_control import ChargeControl
|
||||
# 2022-04-20 12:31:15,552 :: INFO :: Approaching scheduled charging time, but should not charge. Postponing charge hour!
|
||||
# 2022-04-20 12:31:15,552 :: INFO :: Changing stop_hour to 11:0
|
||||
|
||||
class MyTestCase(unittest.TestCase):
|
||||
|
||||
def test_something(self):
|
||||
class TestChargeControl(unittest.TestCase):
|
||||
|
||||
def test_charge_control(self):
|
||||
my_logger()
|
||||
ChargeControl.MQTT_TIMEOUT = 0
|
||||
|
||||
now = datetime.datetime.now()
|
||||
stop_hour = now + datetime.timedelta(minutes=2)
|
||||
|
||||
vin = "123"
|
||||
percentage_threshold = 70
|
||||
|
||||
state = {
|
||||
"charging": True,
|
||||
"stop_hour": [now.hour, now.minute + 2]
|
||||
"stop_hour": [stop_hour.hour, stop_hour.minute]
|
||||
}
|
||||
|
||||
expectations = {
|
||||
|
||||
Reference in New Issue
Block a user