bioweb  0.09.92
C++/Python(django)/JavaScript(angularJS) framework
test02_services.js
Go to the documentation of this file.
1 
4 var injector = angular.injector(['ng', 'myApp']);
5 var srv = injector.get('srvInfo')
6 var srv2 = injector.get('srvCommands')
7 srv.baseURL = "http://127.0.0.1:50008/"; //port for srv.py mock service
8 srv2.baseURL = "http://127.0.0.1:50008/"; //port for srv.py mock service
9 
10 module( "test02_services", {
11  setup: function() {
12  this.$scope = injector.get('$rootScope').$new();
13  },
14  teardown: function() { }
15 });
16 
17 function functionResponseCheck(r) {
18  //ok( 1 == "1", "function response check");
19  ok( typeof(r) != undefined && r.ala == "ala", "srv.py non-empty response testing" );
20 }
21 
22 asyncTest( "service getVersion", function() {
23  expect( 1 );
24  var srv = injector.get('srvInfo');
25  srv.getVersion(functionResponseCheck);
26  setTimeout(
27  function() {
28  start();
29  },
30  100);
31 });
32 
33 asyncTest( "service getCurrent", function() {
34  expect( 1 );
35  var srv = injector.get('srvInfo');
36  srv.getCurrent(functionResponseCheck);
37  setTimeout(
38  function() {
39  start();
40  },
41  100);
42 });
43 
44 asyncTest( "service getCppNumber", function() {
45  expect( 1 );
46  var srv = injector.get('srvInfo');
47  srv.getCppNumber(functionResponseCheck);
48  setTimeout(
49  function() {
50  start();
51  },
52  100);
53 });
54 
55 asyncTest( "service getCppCommands", function() {
56  expect( 1 );
57  var srv2 = injector.get('srvCommands');
58  srv2.getCppCommands(functionResponseCheck);
59  setTimeout(
60  function() {
61  start();
62  },
63  100);
64 });
65 
66 
67 
68 
Definition: srv.py:1