diff --git a/.gitattributes b/.gitattributes index b70fe8b5..514520d4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1 @@ -lnbits/static/vendor/** linguist-vendored -lnbits/extensions/**/static/vendor/** linguist-vendored +**/static/vendor/** linguist-vendored diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..6609003b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: python + +python: + - "3.6" + - "3.7" + - "3.8" + +install: + - pip install -r requirements.txt + - pip install pytest pytest-cov codecov + +script: + - pytest --cov=lnbits + +after_success: + - codecov diff --git a/Pipfile b/Pipfile index aa3f48d3..d38b8abe 100644 --- a/Pipfile +++ b/Pipfile @@ -28,4 +28,3 @@ flake8 = "*" flake8-mypy = "*" pytest = "*" pytest-cov = "*" -pytest-sugar = "*" diff --git a/Pipfile.lock b/Pipfile.lock index 889a38de..2015aeaa 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "1c40bedbf1f2a9e9bccd443b57bd6dda496361df8712ddda5efcec0d00cab9f1" + "sha256": "e9d46b050c5ef3119fd7966d954dd2d20f6179c14bd1e1839b99488ef655f91b" }, "pipfile-spec": 6, "requires": { @@ -32,6 +32,44 @@ "index": "pypi", "version": "==3.1.6" }, + "brotli": { + "hashes": [ + "sha256:0538dc1744fd17c314d2adc409ea7d1b779783b89fd95bcfb0c2acc93a6ea5a7", + "sha256:0970a47f471782912d7705160b2b0a9306e68e6fadf9cffcaeb42d8f0951e26c", + "sha256:113f51658e6fe548dce4b3749f6ef6c24de4184ba9c10a909cbee4261c2a5da0", + "sha256:1e1aa9c4d1558889f42749c8baf846007953bfd32c8209230cf1cd1f5ef33495", + "sha256:2f2f4f78f29ac4a45d15b3d9fc3fd9705e0ad313a44b129f6e1d0c6916bad0e2", + "sha256:3269f6de1dd150fd0cce1c158b61ff5ac06d627fd3ae9c6ea03aed26fbbff7ea", + "sha256:3f4a1f6240916c7984c7f2542786710f622992508dafee0b1714e6d340fb9ffd", + "sha256:50dd9ad2a2bb12da4e9002a438672d182f98e546e99952de80280a1e1729664f", + "sha256:5519a4b01b1a4f965083cbfa2ef2b9774c5a5f352341c47b50776ad109423d72", + "sha256:5eb27722d320370315971c427eb8aa7cc0791f2a458840d357ac653bd0ad3a14", + "sha256:5f06b4d5b6f58e5b5c220c2f23cad034dc5efa51b01fde2351ced1605bd980e2", + "sha256:71ceee286ea7ec613f1c36f1c6181864a6ca24ebb55e371276f33d6af8742834", + "sha256:72848d25a5f9e736db4af4512e0c3feecc094d57d241f8f1ae959115a2c39756", + "sha256:743001bca75f4a6b4454be3510feca46f9d61a0c782a9bc2bc684bdb245e279e", + "sha256:7ac98c71a15648fd11bc1f32608b6110e396121280790082e32b9a3109048bc6", + "sha256:9d1c2dd27a1083fefd05b1b2f8df4a6bc2aaa6c21dd82cd41c8ae5e7c23a87f8", + "sha256:a13ce9b419fe9f277c63f700efb0e444331509d1881b5610d2ba7e9080606967", + "sha256:a19ef0952b9d2803df88dff07f45a6c92d5676afb9b8d69cf32232d684036d11", + "sha256:ad766ca8b8c1419b71a22756b45264f45725c86133dc80a7cbe30b6b78c75620", + "sha256:ad7963f261988ee0883816b6b9f206f11461c9b3cb5cfbca0c9ab5adc406d395", + "sha256:af0451e23016631a2f52925a10d738ac4a0f794ac315c30380b22efc0c90cbc6", + "sha256:c16201060c5a3f8742e3deae759014251ac92f382f82bc2a41dc079ff18c3f24", + "sha256:c43b202f65891861a9a336984a103de25de235f756de69e32db893156f767013", + "sha256:c675c6cce4295cb1a692f3de7416aacace7314e064b94bc86e93aceefce7fd3e", + "sha256:d17cec0b992b1434f5f9df9986563605a4d1b1acd5574c87fc2ac014bcbd3316", + "sha256:dc91f6129953861a73d9a65c52a8dd682b561a9ebaf65283541645cab6489917", + "sha256:e2f4cbd1760d2bf2f30e396c2301999aab0191aec031a6a8a04950b2f575a536", + "sha256:f192e6d3556714105c10486bbd6d045e38a0c04d9da3cef21e0a8dfd8e162df4", + "sha256:f775b07026af2b1b0b5a8b05e41571cdcf3a315a67df265d60af301656a5425b", + "sha256:f969ec7f56ba9636679e69ca07fba548312ccaca37412ee823c7f413541ad7e0", + "sha256:f9dc52cd70907aafb99a773b66b156f2f995c7a0d284397c487c8b71ddbef2f9", + "sha256:f9ee88bb52352588ceb811d045b5c9bb1dc38927bc150fd156244f60ff3f59f1", + "sha256:fc7212e36ebeb81aebf7949c92897b622490d7c0e333a479c0395591e7994600" + ], + "version": "==1.0.7" + }, "cerberus": { "hashes": [ "sha256:302e6694f206dd85cb63f13fd5025b31ab6d38c99c50c6d769f8fa0b0f299589" @@ -78,10 +116,10 @@ }, "flask-compress": { "hashes": [ - "sha256:468693f4ddd11ac6a41bca4eb5f94b071b763256d54136f77957cfee635badb3" + "sha256:f367b2b46003dd62be34f7fb1379938032656dca56377a9bc90e7188e4289a7c" ], "index": "pypi", - "version": "==1.4.0" + "version": "==1.5.0" }, "flask-talisman": { "hashes": [ @@ -335,25 +373,25 @@ }, "pydantic": { "hashes": [ - "sha256:0b7aadfa1de28057656064e04d9f018d1b186fe2a8e953a2fb41545873b7cf95", - "sha256:0f61e67291b99a927816558a218a4e794db72a33621c836e63d12613a2202cd4", - "sha256:20946280c750753b3e3177c748825ef189d7ab86c514f6a0b118621110d5f0d3", - "sha256:22139ee446992c222977ac0a9269c4da2e9ecc1834f84804ebde008a4649b929", - "sha256:3c0f39e884d7a3572d5cc8322b0fe9bf66114283e22e05a5c4b8961c19588945", - "sha256:446ce773a552a2cb90065d4aa645e16fa7494369b5f0d199e4d41a992a98204d", - "sha256:475e6606873e40717cc3b0eebc7d1101cbfc774e01dadeeea24c121eb5826b86", - "sha256:66124752662de0479a9d0c17bdebdc8a889bccad8846626fb66d8669e8eafb63", - "sha256:896637b7d8e4cdc0bcee1704fcadacdd167c35ac29f02a4395fce7a033925f26", - "sha256:9af44d06db33896a2176603c9cb876df3a60297a292a24d3018956a910cc1402", - "sha256:9e46fac8a4674db0777fd0133aa56817e1481beee50971bab39dded7639f9b2b", - "sha256:ae206e103e976c40ec294cd6c8fcbfbdaced3ab9b736bc53d03fa11b5aaa1628", - "sha256:b11d0bd7ecf41098894e8777ee623c29554dbaa37e862c51bcc5a2b950d1bf77", - "sha256:d73070028f7b046a5b2e611a9799c238d7bd245f8fe30f4ad7ff29ddb63aac40", - "sha256:ddedcdf9d5c24939578449a8e099ceeec3b3d76243fc143aff63ebf6d5aade10", - "sha256:e08e21f4d5395ac17cde19de26be63fb16fb870f0cfde1481ddc22d5e2353548", - "sha256:e6239199b363bc53262bcb57f1441206d4b2d46b392eccba2213d8358d6e284a" + "sha256:0a1cdf24e567d42dc762d3fed399bd211a13db2e8462af9dfa93b34c41648efb", + "sha256:2007eb062ed0e57875ce8ead12760a6e44bf5836e6a1a7ea81d71eeecf3ede0f", + "sha256:20a15a303ce1e4d831b4e79c17a4a29cb6740b12524f5bba3ea363bff65732bc", + "sha256:2a6904e9f18dea58f76f16b95cba6a2f20b72d787abd84ecd67ebc526e61dce6", + "sha256:3714a4056f5bdbecf3a41e0706ec9b228c9513eee2ad884dc2c568c4dfa540e9", + "sha256:473101121b1bd454c8effc9fe66d54812fdc128184d9015c5aaa0d4e58a6d338", + "sha256:68dece67bff2b3a5cc188258e46b49f676a722304f1c6148ae08e9291e284d98", + "sha256:70f27d2f0268f490fe3de0a9b6fca7b7492b8fd6623f9fecd25b221ebee385e3", + "sha256:8433dbb87246c0f562af75d00fa80155b74e4f6924b0db6a2078a3cd2f11c6c4", + "sha256:8be325fc9da897029ee48d1b5e40df817d97fe969f3ac3fd2434ba7e198c55d5", + "sha256:93b9f265329d9827f39f0fca68f5d72cc8321881cdc519a1304fa73b9f8a75bd", + "sha256:9be755919258d5d168aeffbe913ed6e8bd562e018df7724b68cabdee3371e331", + "sha256:ab863853cb502480b118187d670f753be65ec144e1654924bec33d63bc8b3ce2", + "sha256:b96ce81c4b5ca62ab81181212edfd057beaa41411cd9700fbcb48a6ba6564b4e", + "sha256:da8099fca5ee339d5572cfa8af12cf0856ae993406f0b1eb9bb38c8a660e7416", + "sha256:e2c753d355126ddd1eefeb167fa61c7037ecd30b98e7ebecdc0d1da463b4ea09", + "sha256:f0018613c7a0d19df3240c2a913849786f21b6539b9f23d85ce4067489dfacfa" ], - "version": "==1.5" + "version": "==1.5.1" }, "pylightning": { "hashes": [ @@ -626,14 +664,6 @@ "index": "pypi", "version": "==2.8.1" }, - "pytest-sugar": { - "hashes": [ - "sha256:26cf8289fe10880cbbc130bd77398c4e6a8b936d8393b116a5c16121d95ab283", - "sha256:fcd87a74b2bce5386d244b49ad60549bfbc4602527797fac167da147983f58ab" - ], - "index": "pypi", - "version": "==0.9.2" - }, "regex": { "hashes": [ "sha256:08119f707f0ebf2da60d2f24c2f39ca616277bb67ef6c92b72cbf90cbe3a556b", @@ -667,12 +697,6 @@ ], "version": "==1.14.0" }, - "termcolor": { - "hashes": [ - "sha256:1d6d69ce66211143803fbc56652b41d73b4a400a2891d7bf7a1cdf4c02de613b" - ], - "version": "==1.1.0" - }, "toml": { "hashes": [ "sha256:229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c", diff --git a/README.md b/README.md index 653520d9..bede6113 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ +LNbits +====== + +[![travis-badge]][travis] +[![codecov-badge]][codecov] +[![license-badge]](LICENSE) ![Lightning network wallet](https://i.imgur.com/EHvK6Lq.png) + # LNbits v0.1 BETA, free and open-source lightning-network wallet/accounts system https://lnbits.com, or run your own LNbits server! @@ -73,3 +80,10 @@ if you want to run Flask in debug mode with autoreload # Tip me If you like this project and might even use or extend it, why not send some tip love! https://paywall.link/to/f4e4e + + +[travis]: https://travis-ci.com/lnbits/lnbits?branch=master +[travis-badge]: https://api.travis-ci.com/lnbits/lnbits.svg?branch=master +[codecov]: https://codecov.io/gh/lnbits/lnbits +[codecov-badge]: https://codecov.io/gh/lnbits/lnbits/branch/master/graph/badge.svg +[license-badge]: https://img.shields.io/badge/license-MIT-blue.svg diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 00000000..16f35407 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,11 @@ +import pytest + +from lnbits import app + + +@pytest.fixture +def client(): + app.config["TESTING"] = True + + with app.test_client() as client: + yield client diff --git a/tests/core/test_views.py b/tests/core/test_views.py new file mode 100644 index 00000000..377d2fda --- /dev/null +++ b/tests/core/test_views.py @@ -0,0 +1,3 @@ +def test_homepage(client): + r = client.get("/") + assert b"Add a new wallet" in r.data diff --git a/tests/core/test_views_api.py b/tests/core/test_views_api.py new file mode 100644 index 00000000..e69de29b