

def test_parse_bits(self):
    var = IfParser([True]).parse()
    self.assert_(var.resolve({
        
    }))
    var = IfParser([False]).parse()
    self.assertFalse(var.resolve({
        
    }))
    var = IfParser([False, 'or', True]).parse()
    self.assert_(var.resolve({
        
    }))
    var = IfParser([False, 'and', True]).parse()
    self.assertFalse(var.resolve({
        
    }))
    var = IfParser(['not', False, 'and', 'not', False]).parse()
    self.assert_(var.resolve({
        
    }))
    var = IfParser(['not', 'not', True]).parse()
    self.assert_(var.resolve({
        
    }))
    var = IfParser([1, '=', 1]).parse()
    self.assert_(var.resolve({
        
    }))
    var = IfParser([1, 'not', '=', 1]).parse()
    self.assertFalse(var.resolve({
        
    }))
    var = IfParser([1, 'not', 'not', '=', 1]).parse()
    self.assert_(var.resolve({
        
    }))
    var = IfParser([1, '!=', 1]).parse()
    self.assertFalse(var.resolve({
        
    }))
    var = IfParser([3, '>', 2]).parse()
    self.assert_(var.resolve({
        
    }))
    var = IfParser([1, '<', 2]).parse()
    self.assert_(var.resolve({
        
    }))
    var = IfParser([2, 'not', 'in', [2, 3]]).parse()
    self.assertFalse(var.resolve({
        
    }))
    var = IfParser([1, 'or', 1, '=', 2]).parse()
    self.assert_(var.resolve({
        
    }))

dataset/ETHPy150Open aehlke/manabi/apps/utils/templatetags/smartif.py SmartIfTests.test_parse_bits/original