diff --git a/locaudio/__init__.py b/locaudio/__init__.py index f373b7c..0d480e4 100644 --- a/locaudio/__init__.py +++ b/locaudio/__init__.py @@ -28,7 +28,7 @@ def run(host, port, config_filename): global triangulation, detectionserver, fingerprint - import triangulation + import localization import detectionserver import fingerprint diff --git a/locaudio/detectionserver.py b/locaudio/detectionserver.py index 02c35e1..4c1842d 100644 --- a/locaudio/detectionserver.py +++ b/locaudio/detectionserver.py @@ -13,7 +13,7 @@ from point import Point import config import json -import triangulation as tri +import localization as tri import fingerprint import plot import db diff --git a/locaudio/triangulation.py b/locaudio/localization.py similarity index 100% rename from locaudio/triangulation.py rename to locaudio/localization.py diff --git a/locaudio/plot.py b/locaudio/plot.py index e376a50..66d7f17 100644 --- a/locaudio/plot.py +++ b/locaudio/plot.py @@ -1,5 +1,5 @@ -import triangulation as tri +import localization as tri import numpy as np import matplotlib.pyplot as plt from matplotlib import cm diff --git a/tests/test_server.py b/tests/test_server.py index f2fcf50..fc8c3af 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -57,11 +57,19 @@ class ServerTest(unittest.TestCase): - def test_server_notify(self): + def test_server_notify_added(self): for d_dict in d_dicts: ret_dict = loc.notify_event(d_dict) - print "\n=== Server Notify === :: {0}\n".format(ret_dict) + print "\n=== Server Notify Added === :: {0}\n".format(ret_dict) + + + def test_server_notify_not_added(self): + for d_dict in d_dicts: + d_dict["fingerprint"] = [1, 2, 3, 4] + ret_dict = loc.notify_event(d_dict) + + print "\n=== Server Notify Not Added === :: {0}\n".format(ret_dict) def test_server_triangulation(self): diff --git a/tests/test_triangulation.py b/tests/test_triangulation.py index 70d6c84..5ad6766 100644 --- a/tests/test_triangulation.py +++ b/tests/test_triangulation.py @@ -4,7 +4,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "..")) -import locaudio.triangulation as tri +import locaudio.localization as tri import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.mplot3d import Axes3D @@ -30,7 +30,7 @@ def setUp(self): def test_position_probability(self): - l_ref = 100 + l_ref = 65 r_ref = 1 test_x = 0 @@ -63,7 +63,7 @@ def test_optimization_list(self): def test_optimization(self): - l_ref = 100 + l_ref = 65 r_ref = 1 res = tri.determine_sound_locations( @@ -78,7 +78,7 @@ def test_optimization(self): def test_together(self): r_ref = 1 - l_ref = 100 + l_ref = 65 res = tri.determine_sound_locations( r_ref, l_ref,