Ejemplo n.º 1
0
def hello(cellnumber):
    hostname = socket.gethostname()
    rate = phone.getCheapestRate(cellnumber)
    operator = phone.getCheapestOperator(cellnumber)
    output = {
        "hostname": hostname,
        "phone": cellnumber,
        "rate": rate,
        "operator": operator
    }
    output = json.dumps(output)
    return output
Ejemplo n.º 2
0
 def test_getoperator2(self):
     test = phone.getCheapestOperator("2683246556")
     self.assertEqual(test, "B")
Ejemplo n.º 3
0
 def test_getoperator3(self):
     test = phone.getCheapestOperator("56562683246556")
     self.assertEqual(test, "NONE")
Ejemplo n.º 4
0
 def test_getoperator1(self):
     test = phone.getCheapestOperator("146556")
     self.assertEqual(test, "A")