def test_simple_not(self):
     self.assertEqual(Search.points("not"), " NOT")
 def test_simple_and(self):
     self.assertEqual(Search.points("and"), " AND")
 def test_simple_or(self):
     self.assertEqual(Search.points("or"), " OR")
 def test_simple_point(self):
     self.assertEqual(Search.points("*12"), " points.point_id = 12")
 def test_simple_device(self):
     self.assertEqual(Search.points("%12"), " devices.device_id = 12")
    def test_where_tag_not_building(self):
        self.assertEqual(
            Points.where(Search.points("#2 and not @2")),
            """[{"point_id":2,"point_name":"CMC.328.SP","device_id":1,"device_name":"Fishbowl thermostat","room_id":1,"room_name":"328","building_id":1,"building_name":"CMC","value_type":{"value_type_id":4,"type":["NRML", "FAULT", "OFFNRML", "HIGH", "LOW"]},"value_unit":{"value_unit_id":1,"measurement":"temperature","unit":"fahrenheit"},"tags":["classroom","math_stats","academic","thermostat","computer_science","room_temp","set"],"description":"Thermostat Set Point in CMC 328"}, 
 {"point_id":5,"point_name":"CMC.102.SP","device_id":4,"device_name":"102 Lab thermostat","room_id":3,"room_name":"102","building_id":1,"building_name":"CMC","value_type":{"value_type_id":2,"type":1},"value_unit":{"value_unit_id":1,"measurement":"temperature","unit":"fahrenheit"},"tags":["math_stats","academic","computer_science","set"],"description":"Thermostat Set Point in CMC 102"}]"""
        )
 def test_simple_room(self):
     self.assertEqual(Search.points("$12"), " rooms.room_id = 12")
    def test_where_building(self):
        self.assertEqual(
            Points.where(Search.points("@2")),
            """[{"point_id":4,"point_name":"EV.RM107.SP","device_id":3,"device_name":"Thermostat in Evans 107","room_id":4,"room_name":"107","building_id":2,"building_name":"Evans","value_type":{"value_type_id":3,"type":1.0},"value_unit":{"value_unit_id":1,"measurement":"temperature","unit":"fahrenheit"},"tags":["thermostat","residential","single","residence","room_temp","set"],"description":"Thermostat Set Point in Evans 107"}, 
 {"point_id":3,"point_name":"EV.RM107.RT","device_id":3,"device_name":"Thermostat in Evans 107","room_id":4,"room_name":"107","building_id":2,"building_name":"Evans","value_type":{"value_type_id":2,"type":1},"value_unit":{"value_unit_id":1,"measurement":"temperature","unit":"fahrenheit"},"tags":["thermostat","residential","get","single","residence","room_temp"],"description":"Room Temp in Evans 107"}]"""
        )