Coverage for tests / unit / fuzzer / fengine / retrier / test_utils.py: 0%

9 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-03-20 10:09 -0400

1from graphqler.fuzzer.engine.retrier.utils import find_block_end, remove_lines_within_range 

2 

3test_payload = """ 

4mutation { 

5 createTransaction( 

6 amount: 3.1415 

7 currencyID: "6b64de06-09f9-492e-be5e-5be1203e249a" 

8 payerID: "1234567890" 

9 walletID: "18598551-f720-47a8-b837-eff2e1a5be6b" 

10 ) { 

11 id 

12 amount 

13 rate 

14 payer { 

15 id 

16 firstName 

17 lastName 

18 description 

19 wallets { 

20 id 

21 name 

22 currency { 

23 id 

24 abbreviation 

25 symbol 

26 rate 

27 country 

28 } 

29 transactions { 

30 id 

31 amount 

32 rate 

33 payer { 

34 id 

35 firstName 

36 lastName 

37 description 

38 wallets { 

39 id 

40 name 

41 currency { 

42 id 

43 abbreviation 

44 symbol 

45 rate 

46 country 

47 } 

48 balance 

49 } 

50 } 

51 description 

52 location { 

53 id 

54 lat 

55 lng 

56 name 

57 } 

58 timestamp 

59 } 

60 balance 

61 } 

62 } 

63 description 

64 location { 

65 id 

66 lat 

67 lng 

68 name 

69 } 

70 timestamp 

71 } 

72} 

73""" 

74 

75resulting_payload = """ 

76mutation { 

77 createTransaction( 

78 amount: 3.1415 

79 currencyID: "6b64de06-09f9-492e-be5e-5be1203e249a" 

80 payerID: "1234567890" 

81 walletID: "18598551-f720-47a8-b837-eff2e1a5be6b" 

82 ) { 

83 id 

84 amount 

85 rate 

86 description 

87 location { 

88 id 

89 lat 

90 lng 

91 name 

92 } 

93 timestamp 

94 } 

95} 

96""" 

97 

98 

99def test_find_block_end(): 

100 assert find_block_end(test_payload, 11) == 59 

101 

102 

103def test_remove_lines_within_range(): 

104 start_line = 11 

105 block_end_number = find_block_end(test_payload, start_line) 

106 assert remove_lines_within_range(test_payload, start_line, block_end_number) == resulting_payload