1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-08-23 18:12:20 +00:00

Flake8, Semver, Pre-commit

* Added pre-commit: http://pre-commit.com
* Fixed flake8 errors
* Added flake8 pre-commit hooks
* Added pre-commit to Makefile
* Changed VERSION numbering
* Changed versioning to match PEP-0440
This commit is contained in:
J. Fernando Sánchez
2017-01-10 11:10:10 +01:00
parent 7fd69cc690
commit db30257373
21 changed files with 59 additions and 102 deletions

View File

@@ -103,7 +103,7 @@ class BlueprintsTest(TestCase):
self.assertCode(resp, 200)
js = parse_resp(resp)
assert "is_activated" in js
assert js["is_activated"] == False
assert not js["is_activated"]
resp = self.client.get("/api/plugins/Dummy/activate")
self.assertCode(resp, 200)
sleep(0.5)
@@ -111,7 +111,7 @@ class BlueprintsTest(TestCase):
self.assertCode(resp, 200)
js = parse_resp(resp)
assert "is_activated" in js
assert js["is_activated"] == True
assert js["is_activated"]
def test_default(self):
""" Show only one plugin"""

View File

@@ -1,4 +1,3 @@
import os
import logging
from functools import partial

View File

@@ -44,6 +44,7 @@ class ExtensionsTest(TestCase):
assert name == 'TestPip'
assert module
import noop
dir(noop)
def test_installing(self):
""" Enabling a plugin """

View File

@@ -1,21 +1,16 @@
import os
import logging
import jsonschema
import json
import os
from unittest import TestCase
from senpy.models import Response, Entry, Results, Sentiment, EmotionSet, Emotion, Error
from senpy.models import Entry, Results, Sentiment, EmotionSet, Error
from senpy.plugins import SenpyPlugin
from pprint import pprint
class ModelsTest(TestCase):
def test_jsonld(self):
ctx = os.path.normpath(
os.path.join(__file__, "..", "..", "..", "senpy", "schemas",
"context.jsonld"))
prueba = {"id": "test", "analysis": [], "entries": []}
r = Results(**prueba)
print("Response's context: ")

View File

@@ -1,15 +1,11 @@
#!/bin/env python
import os
import logging
import pickle
import shutil
import tempfile
import json
import os
from unittest import TestCase
from flask import Flask
from senpy.models import Results, Entry
from senpy.plugins import SentimentPlugin, ShelfMixin

View File

@@ -6,8 +6,7 @@ import os
from os import path
from fnmatch import fnmatch
import pyld
from jsonschema import validate, RefResolver, Draft4Validator, ValidationError
from jsonschema import RefResolver, Draft4Validator, ValidationError
root_path = path.join(path.dirname(path.realpath(__file__)), '..')
schema_folder = path.join(root_path, 'senpy', 'schemas')