<s> from tests import unittest <EOL> from boto3 . exceptions import DynamoDBOperationNotSupportedError <EOL> from boto3 . exceptions import DynamoDBNeedsConditionError <EOL> from boto3 . exceptions import DynamoDBNeedsKeyConditionError <EOL> from boto3 . dynamodb . conditions import Attr , Key <EOL> from boto3 . dynamodb . conditions import And , Or , Not , Equals , LessThan <EOL> from boto3 . dynamodb . conditions import LessThanEquals , GreaterThan <EOL> from boto3 . dynamodb . conditions import GreaterThanEquals , BeginsWith , Between <EOL> from boto3 . dynamodb . conditions import NotEquals , In , AttributeExists <EOL> from boto3 . dynamodb . conditions import AttributeNotExists , Contains , Size <EOL> from boto3 . dynamodb . conditions import AttributeType <EOL> from boto3 . dynamodb . conditions import ConditionExpressionBuilder <EOL> class TestK ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . attr = Key ( '<STR_LIT>' ) <EOL> self . attr2 = Key ( '<STR_LIT>' ) <EOL> self . value = '<STR_LIT:foo>' <EOL> self . value2 = '<STR_LIT>' <EOL> def test_and ( self ) : <EOL> with self . assertRaisesRegexp ( <EOL> DynamoDBOperationNotSupportedError , '<STR_LIT>' ) : <EOL> self . attr & self . attr2 <EOL> def test_or ( self ) : <EOL> with self . assertRaisesRegexp ( <EOL> DynamoDBOperationNotSupportedError , '<STR_LIT>' ) : <EOL> self . attr | self . attr2 <EOL> def test_not ( self ) : <EOL> with self . assertRaisesRegexp ( <EOL> DynamoDBOperationNotSupportedError , '<STR_LIT>' ) : <EOL> ~ self . attr <EOL> def test_eq ( self ) : <EOL> self . assertEqual ( <EOL> self . attr . eq ( self . value ) , Equals ( self . attr , self . value ) ) <EOL> def test_lt ( self ) : <EOL> self . assertEqual ( <EOL> self . attr . lt ( self . value ) , LessThan ( self . attr , self . value ) ) <EOL> def test_lte ( self ) : <EOL> self . assertEqual ( <EOL> self . attr . lte ( self . value ) , LessThanEquals ( self . attr , self . value ) ) <EOL> def test_gt ( self ) : <EOL> self . assertEqual ( <EOL> self . attr . gt ( self . value ) , GreaterThan ( self . attr , self . value ) ) <EOL> def test_gte ( self ) : <EOL> self . assertEqual ( <EOL> self . attr . gte ( self . value ) , <EOL> GreaterThanEquals ( self . attr , self . value ) ) <EOL> def test_begins_with ( self ) : <EOL> self . assertEqual ( self . attr . begins_with ( self . value ) , <EOL> BeginsWith ( self . attr , self . value ) ) <EOL> def test_between ( self ) : <EOL> self . assertEqual ( self . attr . between ( self . value , self . value2 ) , <EOL> Between ( self . attr , self . value , self . value2 ) ) <EOL> class TestA ( TestK ) : <EOL> def setUp ( self ) : <EOL> self . attr = Attr ( '<STR_LIT>' ) <EOL> self . attr2 = Attr ( '<STR_LIT>' ) <EOL> self . value = '<STR_LIT:foo>' <EOL> self . value2 = '<STR_LIT>' <EOL> def test_ne ( self ) : <EOL> self . assertEqual ( self . attr . ne ( self . value ) , <EOL> NotEquals ( self . attr , self . value ) ) <EOL> def test_is_in ( self ) : <EOL> self . assertEqual ( self . attr . is_in ( [ self . value ] ) , <EOL> In ( self . attr , [ self . value ] ) ) <EOL> def test_exists ( self ) : <EOL> self . assertEqual ( self . attr . exists ( ) , AttributeExists ( self . attr ) ) <EOL> def test_not_exists ( self ) : <EOL> self . assertEqual ( self . attr . not_exists ( ) , AttributeNotExists ( self . attr ) ) <EOL> def test_contains ( self ) : <EOL> self . assertEqual ( self . attr . contains ( self . value ) , <EOL> Contains ( self . attr , self . value ) ) <EOL> def test_size ( self ) : <EOL> self . assertEqual ( self . attr . size ( ) , Size ( self . attr ) ) <EOL> def test_attribute_type ( self ) : <EOL> self . assertEqual ( self . attr . attribute_type ( self . value ) , <EOL> AttributeType ( self . attr , self . value ) ) <EOL> class TestConditions ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . value = Attr ( '<STR_LIT>' ) <EOL> self . value2 = '<STR_LIT:foo>' <EOL> def build_and_assert_expression ( self , condition , <EOL> reference_expression_dict ) : <EOL> expression_dict = condition . get_expression ( ) <EOL> self . assertDictEqual ( expression_dict , reference_expression_dict ) <EOL> def test_equal_operator ( self ) : <EOL> cond1 = Equals ( self . value , self . value2 ) <EOL> cond2 = Equals ( self . value , self . value2 ) <EOL> self . assertTrue ( cond1 == cond2 ) <EOL> def test_equal_operator_type ( self ) : <EOL> cond1 = Equals ( self . value , self . value2 ) <EOL> cond2 = NotEquals ( self . value , self . value2 ) <EOL> self . assertFalse ( cond1 == cond2 ) <EOL> def test_equal_operator_value ( self ) : <EOL> cond1 = Equals ( self . value , self . value2 ) <EOL> cond2 = Equals ( self . value , self . value ) <EOL> self . assertFalse ( cond1 == cond2 ) <EOL> def test_not_equal_operator ( self ) : <EOL> cond1 = Equals ( self . value , self . value2 ) <EOL> cond2 = NotEquals ( self . value , self . value ) <EOL> self . assertTrue ( cond1 != cond2 ) <EOL> def test_and_operator ( self ) : <EOL> cond1 = Equals ( self . value , self . value2 ) <EOL> cond2 = Equals ( self . value , self . value2 ) <EOL> self . assertEqual ( cond1 & cond2 , And ( cond1 , cond2 ) ) <EOL> def test_and_operator_throws_excepetion ( self ) : <EOL> cond1 = Equals ( self . value , self . value2 ) <EOL> with self . assertRaisesRegexp ( <EOL> DynamoDBOperationNotSupportedError , '<STR_LIT>' ) : <EOL> cond1 & self . value2 <EOL> def test_or_operator ( self ) : <EOL> cond1 = Equals ( self . value , self . value2 ) <EOL> cond2 = Equals ( self . value , self . value2 ) <EOL> self . assertEqual ( cond1 | cond2 , Or ( cond1 , cond2 ) ) <EOL> def test_or_operator_throws_excepetion ( self ) : <EOL> cond1 = Equals ( self . value , self . value2 ) <EOL> with self . assertRaisesRegexp ( <EOL> DynamoDBOperationNotSupportedError , '<STR_LIT>' ) : <EOL> cond1 | self . value2 <EOL> def test_not_operator ( self ) : <EOL> cond1 = Equals ( self . value , self . value2 ) <EOL> self . assertEqual ( ~ cond1 , Not ( cond1 ) ) <EOL> def test_eq ( self ) : <EOL> self . build_and_assert_expression ( <EOL> Equals ( self . value , self . value2 ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:=>' , '<STR_LIT>' : ( self . value , self . value2 ) } ) <EOL> def test_ne ( self ) : <EOL> self . build_and_assert_expression ( <EOL> NotEquals ( self . value , self . value2 ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : ( self . value , self . value2 ) } ) <EOL> def test_lt ( self ) : <EOL> self . build_and_assert_expression ( <EOL> LessThan ( self . value , self . value2 ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:<>' , '<STR_LIT>' : ( self . value , self . value2 ) } ) <EOL> def test_lte ( self ) : <EOL> self . build_and_assert_expression ( <EOL> LessThanEquals ( self . value , self . value2 ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : ( self . value , self . value2 ) } ) <EOL> def test_gt ( self ) : <EOL> self . build_and_assert_expression ( <EOL> GreaterThan ( self . value , self . value2 ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:>>' , '<STR_LIT>' : ( self . value , self . value2 ) } ) <EOL> def test_gte ( self ) : <EOL> self . build_and_assert_expression ( <EOL> GreaterThanEquals ( self . value , self . value2 ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : ( self . value , self . value2 ) } ) <EOL> def test_in ( self ) : <EOL> cond = In ( self . value , ( self . value2 ) ) <EOL> self . build_and_assert_expression ( <EOL> cond , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : ( self . value , ( self . value2 ) ) } ) <EOL> self . assertTrue ( cond . has_grouped_values ) <EOL> def test_bet ( self ) : <EOL> self . build_and_assert_expression ( <EOL> Between ( self . value , self . value2 , '<STR_LIT>' ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : ( self . value , self . value2 , '<STR_LIT>' ) } ) <EOL> def test_beg ( self ) : <EOL> self . build_and_assert_expression ( <EOL> BeginsWith ( self . value , self . value2 ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : ( self . value , self . value2 ) } ) <EOL> def test_cont ( self ) : <EOL> self . build_and_assert_expression ( <EOL> Contains ( self . value , self . value2 ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : ( self . value , self . value2 ) } ) <EOL> def test_ae ( self ) : <EOL> self . build_and_assert_expression ( <EOL> AttributeExists ( self . value ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : ( self . value , ) } ) <EOL> def test_ane ( self ) : <EOL> self . build_and_assert_expression ( <EOL> AttributeNotExists ( self . value ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : ( self . value , ) } ) <EOL> def test_size ( self ) : <EOL> self . build_and_assert_expression ( <EOL> Size ( self . value ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:size>' , '<STR_LIT>' : ( self . value , ) } ) <EOL> def test_size_can_use_attr_methods ( self ) : <EOL> size = Size ( self . value ) <EOL> self . build_and_assert_expression ( <EOL> size . eq ( self . value ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:=>' , '<STR_LIT>' : ( size , self . value ) } ) <EOL> def test_size_can_use_and ( self ) : <EOL> size = Size ( self . value ) <EOL> ae = AttributeExists ( self . value ) <EOL> self . build_and_assert_expression ( <EOL> size & ae , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : ( size , ae ) } ) <EOL> def test_attribute_type ( self ) : <EOL> self . build_and_assert_expression ( <EOL> AttributeType ( self . value , self . value2 ) , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : ( self . value , self . value2 ) } ) <EOL> def test_and ( self ) : <EOL> cond1 = Equals ( self . value , self . value2 ) <EOL> cond2 = Equals ( self . value , self . value2 ) <EOL> and_cond = And ( cond1 , cond2 ) <EOL> self . build_and_assert_expression ( <EOL> and_cond , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : ( cond1 , cond2 ) } ) <EOL> def test_or ( self ) : <EOL> cond1 = Equals ( self . value , self . value2 ) <EOL> cond2 = Equals ( self . value , self . value2 ) <EOL> or_cond = Or ( cond1 , cond2 ) <EOL> self . build_and_assert_expression ( <EOL> or_cond , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : ( cond1 , cond2 ) } ) <EOL> def test_not ( self ) : <EOL> cond = Equals ( self . value , self . value2 ) <EOL> not_cond = Not ( cond ) <EOL> self . build_and_assert_expression ( <EOL> not_cond , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : ( cond , ) } ) <EOL> class TestConditionExpressionBuilder ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . builder = ConditionExpressionBuilder ( ) <EOL> def assert_condition_expression_build ( <EOL> self , condition , ref_string , ref_names , ref_values , <EOL> is_key_condition = False ) : <EOL> exp_string , names , values = self . builder . build_expression ( <EOL> condition , is_key_condition = is_key_condition ) <EOL> self . assertEqual ( exp_string , ref_string ) <EOL> self . assertEqual ( names , ref_names ) <EOL> self . assertEqual ( values , ref_values ) <EOL> def test_bad_input ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> with self . assertRaises ( DynamoDBNeedsConditionError ) : <EOL> self . builder . build_expression ( a ) <EOL> def test_build_expression_eq ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . eq ( '<STR_LIT:foo>' ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_reset ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . eq ( '<STR_LIT:foo>' ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> self . assert_condition_expression_build ( <EOL> a . eq ( '<STR_LIT:foo>' ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> self . builder . reset ( ) <EOL> self . assert_condition_expression_build ( <EOL> a . eq ( '<STR_LIT:foo>' ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_build_expression_lt ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . lt ( '<STR_LIT:foo>' ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_build_expression_lte ( self ) : <EOL> a1 = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a1 . lte ( '<STR_LIT:foo>' ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_build_expression_gt ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . gt ( '<STR_LIT:foo>' ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_build_expression_gte ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . gte ( '<STR_LIT:foo>' ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_build_expression_begins_with ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . begins_with ( '<STR_LIT:foo>' ) , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_build_expression_between ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . between ( '<STR_LIT:foo>' , '<STR_LIT>' ) , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' , '<STR_LIT>' : '<STR_LIT>' } ) <EOL> def test_build_expression_ne ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . ne ( '<STR_LIT:foo>' ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_build_expression_in ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . is_in ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] ) , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : <NUM_LIT:1> , '<STR_LIT>' : <NUM_LIT:2> , '<STR_LIT>' : <NUM_LIT:3> } ) <EOL> def test_build_expression_exists ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . exists ( ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { } ) <EOL> def test_build_expression_not_exists ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . not_exists ( ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { } ) <EOL> def test_build_contains ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . contains ( '<STR_LIT:foo>' ) , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_build_size ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . size ( ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { } ) <EOL> def test_build_size_with_other_conditons ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . size ( ) . eq ( <NUM_LIT:5> ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : <NUM_LIT:5> } ) <EOL> def test_build_attribute_type ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . attribute_type ( '<STR_LIT:foo>' ) , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_build_and ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> a2 = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . eq ( '<STR_LIT:foo>' ) & a2 . eq ( '<STR_LIT:bar>' ) , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' , '<STR_LIT>' : '<STR_LIT:bar>' } ) <EOL> def test_build_or ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> a2 = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . eq ( '<STR_LIT:foo>' ) | a2 . eq ( '<STR_LIT:bar>' ) , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' , '<STR_LIT>' : '<STR_LIT:bar>' } ) <EOL> def test_build_not ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> ~ a . eq ( '<STR_LIT:foo>' ) , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_build_attribute_with_attr_value ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> value = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . eq ( value ) , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } , { } ) <EOL> def test_build_with_is_key_condition ( self ) : <EOL> k = Key ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> k . eq ( '<STR_LIT:foo>' ) , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } , is_key_condition = True ) <EOL> def test_build_with_is_key_condition_throws_error ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> with self . assertRaises ( DynamoDBNeedsKeyConditionError ) : <EOL> self . builder . build_expression ( a . eq ( '<STR_LIT:foo>' ) , is_key_condition = True ) <EOL> def test_build_attr_map ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . eq ( '<STR_LIT:foo>' ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } , <EOL> { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_build_attr_list ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . eq ( '<STR_LIT:foo>' ) , '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT>' } , { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_build_nested_attr_map_list ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> a . eq ( '<STR_LIT:foo>' ) , '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } , <EOL> { '<STR_LIT>' : '<STR_LIT:foo>' } ) <EOL> def test_build_double_nested_and_or ( self ) : <EOL> a = Attr ( '<STR_LIT>' ) <EOL> a2 = Attr ( '<STR_LIT>' ) <EOL> self . assert_condition_expression_build ( <EOL> ( a . eq ( '<STR_LIT:foo>' ) & a2 . eq ( '<STR_LIT>' ) ) | ( a . eq ( '<STR_LIT:bar>' ) & a2 . eq ( '<STR_LIT>' ) ) , <EOL> '<STR_LIT>' , <EOL> { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } , <EOL> { '<STR_LIT>' : '<STR_LIT:foo>' , '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT:bar>' , '<STR_LIT>' : '<STR_LIT>' } ) </s>
