Repository: femueller/python-n26

Issue:
Unexpected Keyword
Hi,
I just try you script. And I have this error at first n26 call.

```
root@weboob:~/.config$ /usr/local/bin/n26 -json balance
Traceback (most recent call last):
  File "/usr/local/bin/n26", line 6, in <module>
    from n26.cli import cli
  File "/usr/local/lib/python3.7/dist-packages/n26/cli.py", line 16, in <module>
    API_CLIENT = api.Api()
  File "/usr/local/lib/python3.7/dist-packages/n26/api.py", line 48, in __init__
    cfg = Config(write_reference=False)
  File "/usr/local/lib/python3.7/dist-packages/n26/config.py", line 30, in __new__
    return super(Config, cls).__new__(cls, *args, **kwargs)
TypeError: __new__() got an unexpected keyword argument 'write_reference'
```

Any idea what's append here ?

Best regards
Azlux

Comments:

Patch:
diff --git a/Pipfile b/Pipfile
index e85533c..f3e36ec 100644
--- a/Pipfile
+++ b/Pipfile
@@ -4,14 +4,14 @@ verify_ssl = true
 name = "pypi"
 
 [packages]
-requests = ">=2.20.0"
+requests = "~=2.20"
 click = "*"
 tabulate = ">=0.8.3"
 PyYAML = "*"
 inflect = "*"
-urllib3 = ">=1.24.2"
-tenacity = ">=5.1.1"
-container-app-conf = ">=4.2.3"
+urllib3 = "~=1.24"
+tenacity = "~=5.1"
+container-app-conf = "~=5.0"
 
 [dev-packages]
 pytest = "*"
diff --git a/Pipfile.lock b/Pipfile.lock
index 72edc0a..c47c23a 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
 {
     "_meta": {
         "hash": {
-            "sha256": "ef5c769f4c362529f55b5b33093bfa851ffcd0c20a06ada43e5ab872867543dc"
+            "sha256": "dfff5a449c0503a149a7a93c843be0b439a14e1409ddd6d5663b55dd9a6c7001"
         },
         "pipfile-spec": 6,
         "requires": {
@@ -40,11 +40,11 @@
         },
         "container-app-conf": {
             "hashes": [
-                "sha256:8647e8fb82595928571d9292e22bb0cc4a3ff7cdafe1aab448d9b4b0623b772c",
-                "sha256:bb691b2f652bed6709d391e09e6f2840b66fa2d981aa0159cff42f0ed38c49cb"
+                "sha256:a400890fc66682cb16bde4a524cd4e9799c6ec7487f62cfa262f443ae4e2cf0d",
+                "sha256:d93605db13154b1db05f632932b98aac676bab5f9febc5f5507ff17394bf7256"
             ],
             "index": "pypi",
-            "version": "==4.2.3"
+            "version": "==5.0.0"
         },
         "idna": {
             "hashes": [
@@ -53,13 +53,27 @@
             ],
             "version": "==2.8"
         },
+        "importlib-metadata": {
+            "hashes": [
+                "sha256:aa18d7378b00b40847790e7c27e11673d7fed219354109d0e7b9e5b25dc3ad26",
+                "sha256:d5f18a79777f3aa179c145737780282e27b508fc8fd688cb17c7a813e8bd39af"
+            ],
+            "version": "==0.23"
+        },
         "inflect": {
             "hashes": [
-                "sha256:4ded1b2a6fcf0fc0397419c7727f131a93b67b80d899f2973be7758628e12b73",
-                "sha256:a82b671b043ddba98ea8b2cf000b31e8b41e9197b3151567239f3bbe215dab7e"
+                "sha256:48a35748cd695881722699d074a61166a2b591cc8c65d5c95d00e59c847b01c2",
+                "sha256:ee7c9b7c3376d06828b205460afb3c447b5d25dd653171db249a238f3fc2c18a"
             ],
             "index": "pypi",
-            "version": "==2.1.0"
+            "version": "==3.0.2"
+        },
+        "more-itertools": {
+            "hashes": [
+                "sha256:409cd48d4db7052af495b09dec721011634af3753ae1ef92d2b32f73a745f832",
+                "sha256:92b8c4b06dac4f0611c0729b2f2ede52b2e1bac1ab48f089c7ddc12e26bb60c4"
+            ],
+            "version": "==7.2.0"
         },
         "py-range-parse": {
             "hashes": [
@@ -70,10 +84,10 @@
         },
         "python-dateutil": {
             "hashes": [
-                "sha256:7e6584c74aeed623791615e26efd690f29817a27c73085b78e4bad02493df2fb",
-                "sha256:c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e"
+                "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c",
+                "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a"
             ],
-            "version": "==2.8.0"
+            "version": "==2.8.1"
         },
         "pytimeparse": {
             "hashes": [
@@ -142,25 +156,25 @@
         },
         "six": {
             "hashes": [
-                "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c",
-                "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
+                "sha256:1f1b7d42e254082a9db6279deae68afb421ceba6158efa6131de7b3003ee93fd",
+                "sha256:30f610279e8b2578cab6db20741130331735c781b56053c59c4076da27f06b66"
             ],
-            "version": "==1.12.0"
+            "version": "==1.13.0"
         },
         "tabulate": {
             "hashes": [
-                "sha256:d0097023658d4dea848d6ae73af84532d1e86617ac0925d1adf1dd903985dac3"
+                "sha256:5470cc6687a091c7042cee89b2946d9235fe9f6d49c193a4ae2ac7bf386737c8"
             ],
             "index": "pypi",
-            "version": "==0.8.5"
+            "version": "==0.8.6"
         },
         "tenacity": {
             "hashes": [
-                "sha256:6a7511a59145c2e319b7d04ddd93c12d48cc3d3c8fa42c2846d33a620ee91f57",
-                "sha256:a4eb168dbf55ed2cae27e7c6b2bd48ab54dabaf294177d998330cf59f294c112"
+                "sha256:3a916e734559f1baa2cab965ee00061540c41db71c3bf25375b81540a19758fc",
+                "sha256:e664bd94f088b17f46da33255ae33911ca6a0fe04b156d334b601a4ef66d3c5f"
             ],
             "index": "pypi",
-            "version": "==5.1.1"
+            "version": "==5.1.5"
         },
         "toml": {
             "hashes": [
@@ -171,21 +185,21 @@
         },
         "urllib3": {
             "hashes": [
-                "sha256:3de946ffbed6e6746608990594d08faac602528ac7015ac28d33cee6a45b7398",
-                "sha256:9a107b99a5393caf59c7aa3c1249c16e6879447533d0887f4336dde834c7be86"
+                "sha256:a8a318824cc77d1fd4b2bec2ded92646630d7fe8619497b142c84a9e6f5a7293",
+                "sha256:f3c5fd51747d450d4dcf6f923c81f78f811aab8205fda64b0aba34a4e48b0745"
             ],
             "index": "pypi",
-            "version": "==1.25.6"
+            "version": "==1.25.7"
+        },
+        "zipp": {
+            "hashes": [
+                "sha256:3718b1cbcd963c7d4c5511a8240812904164b7f381b647143a89d3b98f9bcd8e",
+                "sha256:f06903e9f1f43b12d371004b4ac7b06ab39a44adc747266928ae6debfa7b3335"
+            ],
+            "version": "==0.6.0"
         }
     },
     "develop": {
-        "atomicwrites": {
-            "hashes": [
-                "sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4",
-                "sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6"
-            ],
-            "version": "==1.3.0"
-        },
         "attrs": {
             "hashes": [
                 "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
@@ -202,18 +216,17 @@
         },
         "flake8": {
             "hashes": [
-                "sha256:19241c1cbc971b9962473e4438a2ca19749a7dd002dd1a946eaba171b4114548",
-                "sha256:8e9dfa3cecb2400b3738a42c54c3043e821682b9c840b0448c0503f781130696"
+                "sha256:45681a117ecc81e870cbf1262835ae4af5e7a8b08e40b944a8a6e6b895914cfb",
+                "sha256:49356e766643ad15072a789a20915d3c91dc89fd313ccd71802303fd67e4deca"
             ],
             "index": "pypi",
-            "version": "==3.7.8"
+            "version": "==3.7.9"
         },
         "importlib-metadata": {
             "hashes": [
                 "sha256:aa18d7378b00b40847790e7c27e11673d7fed219354109d0e7b9e5b25dc3ad26",
                 "sha256:d5f18a79777f3aa179c145737780282e27b508fc8fd688cb17c7a813e8bd39af"
             ],
-            "markers": "python_version < '3.8'",
             "version": "==0.23"
         },
         "mccabe": {
@@ -247,10 +260,10 @@
         },
         "pluggy": {
             "hashes": [
-                "sha256:0db4b7601aae1d35b4a033282da476845aa19185c1e6964b25cf324b5e4ec3e6",
-                "sha256:fa5fa1622fa6dd5c030e9cad086fa19ef6a0cf6d7a2d12318e10cb49d6d68f34"
+                "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0",
+                "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"
             ],
-            "version": "==0.13.0"
+            "version": "==0.13.1"
         },
         "py": {
             "hashes": [
@@ -275,25 +288,25 @@
         },
         "pyparsing": {
             "hashes": [
-                "sha256:6f98a7b9397e206d78cc01df10131398f1c8b8510a2f4d97d9abd82e1aacdd80",
-                "sha256:d9338df12903bbf5d65a0e4e87c2161968b10d2e489652bb47001d82a9b028b4"
+                "sha256:20f995ecd72f2a1f4bf6b072b63b22e2eb457836601e76d6e5dfcd75436acc1f",
+                "sha256:4ca62001be367f01bd3e92ecbb79070272a9d4964dce6a48a82ff0b8bc7e683a"
             ],
-            "version": "==2.4.2"
+            "version": "==2.4.5"
         },
         "pytest": {
             "hashes": [
-                "sha256:27abc3fef618a01bebb1f0d6d303d2816a99aa87a5968ebc32fe971be91eb1e6",
-                "sha256:58cee9e09242937e136dbb3dab466116ba20d6b7828c7620f23947f37eb4dae4"
+                "sha256:63344a2e3bce2e4d522fd62b4fdebb647c019f1f9e4ca075debbd13219db4418",
+                "sha256:f67403f33b2b1d25a6756184077394167fe5e2f9d8bdaab30707d19ccec35427"
             ],
             "index": "pypi",
-            "version": "==5.2.2"
+            "version": "==5.3.1"
         },
         "six": {
             "hashes": [
-                "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c",
-                "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
+                "sha256:1f1b7d42e254082a9db6279deae68afb421ceba6158efa6131de7b3003ee93fd",
+                "sha256:30f610279e8b2578cab6db20741130331735c781b56053c59c4076da27f06b66"
             ],
-            "version": "==1.12.0"
+            "version": "==1.13.0"
         },
         "wcwidth": {
             "hashes": [
diff --git a/README.md b/README.md
index e143315..64479e9 100644
--- a/README.md
+++ b/README.md
@@ -118,7 +118,7 @@ This is going to use the same mechanism to load configuration as the CLI tool, t
 from n26.api import Api
 from n26.config import Config
 
-conf = Config(write_reference=False, validate=False)
+conf = Config(validate=False)
 conf.USERNAME.value = "john.doe@example.com"
 conf.PASSWORD.value = "$upersecret"
 conf.LOGIN_DATA_STORE_PATH.value = None
diff --git a/n26/api.py b/n26/api.py
index e0d100e..7a35cf9 100644
--- a/n26/api.py
+++ b/n26/api.py
@@ -45,7 +45,7 @@ class Api(object):
         :param cfg: configuration object
         """
         if not cfg:
-            cfg = Config(write_reference=False)
+            cfg = Config()
         self.config = cfg
         self._token_data = {}
 
diff --git a/n26/config.py b/n26/config.py
index 273ade0..21ee1ff 100644
--- a/n26/config.py
+++ b/n26/config.py
@@ -24,9 +24,6 @@ class Config(ConfigBase):
             ]
             kwargs["data_sources"] = data_sources
 
-        if "write_reference" not in kwargs.keys():
-            kwargs["write_reference"] = False
-
         return super(Config, cls).__new__(cls, *args, **kwargs)
 
     USERNAME = StringConfigEntry(


Test patch:
diff --git a/tests/test_api.py b/tests/test_api.py
index ea10553..d69d222 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -40,7 +40,7 @@ class ApiTests(N26TestBase):
 
     def test_init_with_config(self):
         from container_app_conf.source.yaml_source import YamlSource
-        conf = config.Config(singleton=False, write_reference=False, data_sources=[
+        conf = config.Config(singleton=False, data_sources=[
             YamlSource("test_creds", "./tests/")
         ])
         api_client = api.Api(conf)
diff --git a/tests/test_api_base.py b/tests/test_api_base.py
index b3c698f..92d8e29 100644
--- a/tests/test_api_base.py
+++ b/tests/test_api_base.py
@@ -116,8 +116,7 @@ class N26TestBase(unittest.TestCase):
         singleton=True,
         data_sources=[
             YamlSource("test_creds", "./tests/")
-        ],
-        write_reference=False
+        ]
     )
 
     # this is the Api client