summaryrefslogtreecommitdiff
path: root/python-logassert.spec
blob: e6b9899c76a3298939caf82f53cf1f9692665577 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
%global _empty_manifest_terminate_build 0
Name:		python-logassert
Version:	7
Release:	1
Summary:	Simple but powerful assertion and verification of logged lines.
License:	LGPL-3
URL:		https://github.com/facundobatista/logassert
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/88/db/c9cf2a615b720a6caf55c60611a72ae8cc9ab907e2c24bfeaffd07c0677a/logassert-7.tar.gz
BuildArch:	noarch

Requires:	python3-setuptools

%description
# Log Assertion

![Python package](https://github.com/facundobatista/logassert/workflows/Python%20package/badge.svg)

## What?

A simple log assertion mechanism for Python unittests.


## Why?

As is vox populi, you must also test the logging calls in your programs.

With `logassert` this is now very easy.


# Awesome! How do I use it?

The same functionality is exposed in two very different ways, one that fits better the *pytest semantics*, the other one more suitable for classic unit tests.

## For pytest

All you need to do is to declare `logs` in your test arguments, it works
just like any other fixture.

Then you just check (using `assert`, as usual with *pytest*) if a specific 
line is in the logs for a specific level.

Example:

```python
def test_bleh(logs)
    (...)
    assert "The meaning of life is 42" in logs.debug
```

Actually, the line you write is a regular expression, so you can totally 
do (in case you're not exactly sure which the meaning of life is):

```python
    assert "The meaning of life is \d+" in logs.debug
```

The indicated string is searched to be inside the log lines, it doesn't 
need to be exact whole line. If you want that, just indicate it as with
any regular expression:

```python
    assert "^The meaning of life is \d+$" in logs.debug
```

In a similar way you can also express the desire to check if it's at the 
beginning or at the end of the log lines.

> **NOTE**: the message checked is the final one, after the logging system 
replaced all the indicated parameters in the indicated string.

If you want to verify that a text was logged, no matter at which level,
just do:

```python
    assert "The meaning of life is 42" in logs.any_level
```

To verify that some text was NOT logged, just juse the Python's syntax! 
For example:

```python
    assert "A problem happened" not in logs.error
```

### But I don't like regexes, I want the exact string

Then you just import `Exact` from `logassert` and wrap the string 
with that.

For example, in this case the `..` means exactly two dots, no regex
semantics at all:

```python
    assert Exact("The meaning of life is ..") in logs.any_level
```


### Anyway, I liked old behaviour of searching multiple strings

Then you may want to import `Multiple` from `logassert` and wrap the
different strings you had in each call for the classic behaviour.

For example:

```python
    assert Multiple("life", "meaning", "42") in logs.any_level
```


### What if I want to check that nothing was logged?

The simplest way to do it is to use the `NOTHING` verifier that you can 
import from `logassert`:

```python
    assert NOTHING in logs.debug
```

Note that it doesn't make sense to use it by the negative (`...NOTHING not in logs...`): 
is no really useful at testing level to know that "something was logged", you should
improve the test to specifically verify *what* was logged.


### Breaking the "per line barrier"

Sometimes it's useful to verify that several lines were logged, and that 
those lines are logged one after the other, as they build a "composite 
message".

To achieve that control on the logged lines you can use the `Sequence`
helper, that receives all the lines to verify (regexes by default, but
you can use the other helpers there):

```python
    assert Sequence(
        "Got 2 errors and \d+ warnings:",
        Exact("  error 1: foo"),
        Exact("  error 2: bar"),
    ) in logs.debug
```    


### Examples

After logging...

```python
    person = "madam"
    item = "wallet"
    logger.debug("Excuse me %s, you dropped your %s", person, item)
```

...the following test will just pass:

```python
    assert "Excuse me .*?, you dropped your wallet" in logs.debug
```

However, the following will fail (different text!)...

```python
    assert "Excuse me .*?, you lost your wallet" in logs.debug
```

...producing this message in your tests:

```
assert for regex 'Excuse me .*?, you lost your wallet' check in DEBUG, failed; logged lines:
      DEBUG     'Excuse me madam, you dropped your wallet'
```

This one will also fail (different level!)...

```python
    assert "Excuse me .*?, you dropped your wallet" in logs.info
```

...producing this message in your tests:

```
assert for regex 'Excuse me .*?, you dropped your wallet' check in INFO, failed; logged lines:
       DEBUG     'Excuse me madam, you dropped your wallet'
```

A more complex example, with several log lines, and a specific assertion:

```python
    logger.info("Starting system")
    places = ['/tmp/', '~/temp']
    logger.debug("Checking for config XYZ in all these places %s", places)
    logger.warning("bad config XYZ")

    assert "bad config XYZ" in logs.debug
```

See how the test failure message is super helpful:

```
assert for regex 'bad config XYZ' check in DEBUG, failed; logged lines:
       INFO      'Starting system'
       DEBUG     "Checking for config XYZ in all these places ['/tmp/', '~/temp']"
       WARNING   'bad config XYZ'

```

### What about repeated verifications?

Sometimes it's needed to verify that something if logged only once (e.g.
welcoming messages). In this cases it's super useful to use the `reset`
method.

See the following test sequence:

```python
def test_welcoming message(logs):
    logger.info("foo")  # first log! it should trigger the welcoming message
    assert "Welcome" in logs.info

    logs.reset()
    logger.info("foo")  # second log! it should NOT trigger the welcoming message
    assert "Welcome" not in logs.info
```


## For classic TestCases

All you need to do is to call this module's `setup()` passing the test case
instance, and the logger you want to supervise.

Like

```python
class MyTestCase(unittest.TestCase):
    """Example."""

    def setUp(self):
        logassert.setup(self, 'mylogger')
```

In the example, `mylogger` is the name of the logging to supervise. If
different subsystems of your code log in other loggers, this tester
won't notice.

Then, to use it, just call the `assertLogged` method and it's family,
passing all the strings you want to find. This is the default behaviour for
backwards compatibility.

Example:

```python
    def test_blah(self):
        (...)
        self.assertLoggedDebug('secret', 'life', '42')
```

That line will check that "secret", "life" and "42" are all logged in the
same logging call, in DEBUG level.

So, if you logged this, the test will pass:

```python
logger.debug("The secret of life, the universe and everything is %d", 42)
```

Note that the message checked is the one with all parameters replaced.

But if you logged any of the following, the test will fail (the first because
it misses one of the string, the second because it has the wrong log level)::

```python
logger.debug("The secret of life, the universe and everything is lost")
logger.info("The secret of life, the universe and everything is 42")
```

### What can I test?

You'll have at disposition several assertion methods:

- `self.assertLogged`: will check that the strings 
  were logged, no matter at which level

- `self.assertLoggedLEVEL` (being LEVEL one of Error, 
  Warning, Info, or Debug): will check that the strings were logged at 
  that specific level.

- `self.assertNotLogged`: will check that the 
  strings were NOT logged, no matter at which level

- `self.assertNotLoggedLEVEL` (being LEVEL one of 
  Error, Warning, Info, or Debug): will check that the strings were NOT 
  logged at that specific level.



# Nice! But...

If you need help, or have any question, or found any issue, please open a
ticket [here](https://github.com/facundobatista/logassert/issues/new).

Thanks in advance for your time.




%package -n python3-logassert
Summary:	Simple but powerful assertion and verification of logged lines.
Provides:	python-logassert
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-logassert
# Log Assertion

![Python package](https://github.com/facundobatista/logassert/workflows/Python%20package/badge.svg)

## What?

A simple log assertion mechanism for Python unittests.


## Why?

As is vox populi, you must also test the logging calls in your programs.

With `logassert` this is now very easy.


# Awesome! How do I use it?

The same functionality is exposed in two very different ways, one that fits better the *pytest semantics*, the other one more suitable for classic unit tests.

## For pytest

All you need to do is to declare `logs` in your test arguments, it works
just like any other fixture.

Then you just check (using `assert`, as usual with *pytest*) if a specific 
line is in the logs for a specific level.

Example:

```python
def test_bleh(logs)
    (...)
    assert "The meaning of life is 42" in logs.debug
```

Actually, the line you write is a regular expression, so you can totally 
do (in case you're not exactly sure which the meaning of life is):

```python
    assert "The meaning of life is \d+" in logs.debug
```

The indicated string is searched to be inside the log lines, it doesn't 
need to be exact whole line. If you want that, just indicate it as with
any regular expression:

```python
    assert "^The meaning of life is \d+$" in logs.debug
```

In a similar way you can also express the desire to check if it's at the 
beginning or at the end of the log lines.

> **NOTE**: the message checked is the final one, after the logging system 
replaced all the indicated parameters in the indicated string.

If you want to verify that a text was logged, no matter at which level,
just do:

```python
    assert "The meaning of life is 42" in logs.any_level
```

To verify that some text was NOT logged, just juse the Python's syntax! 
For example:

```python
    assert "A problem happened" not in logs.error
```

### But I don't like regexes, I want the exact string

Then you just import `Exact` from `logassert` and wrap the string 
with that.

For example, in this case the `..` means exactly two dots, no regex
semantics at all:

```python
    assert Exact("The meaning of life is ..") in logs.any_level
```


### Anyway, I liked old behaviour of searching multiple strings

Then you may want to import `Multiple` from `logassert` and wrap the
different strings you had in each call for the classic behaviour.

For example:

```python
    assert Multiple("life", "meaning", "42") in logs.any_level
```


### What if I want to check that nothing was logged?

The simplest way to do it is to use the `NOTHING` verifier that you can 
import from `logassert`:

```python
    assert NOTHING in logs.debug
```

Note that it doesn't make sense to use it by the negative (`...NOTHING not in logs...`): 
is no really useful at testing level to know that "something was logged", you should
improve the test to specifically verify *what* was logged.


### Breaking the "per line barrier"

Sometimes it's useful to verify that several lines were logged, and that 
those lines are logged one after the other, as they build a "composite 
message".

To achieve that control on the logged lines you can use the `Sequence`
helper, that receives all the lines to verify (regexes by default, but
you can use the other helpers there):

```python
    assert Sequence(
        "Got 2 errors and \d+ warnings:",
        Exact("  error 1: foo"),
        Exact("  error 2: bar"),
    ) in logs.debug
```    


### Examples

After logging...

```python
    person = "madam"
    item = "wallet"
    logger.debug("Excuse me %s, you dropped your %s", person, item)
```

...the following test will just pass:

```python
    assert "Excuse me .*?, you dropped your wallet" in logs.debug
```

However, the following will fail (different text!)...

```python
    assert "Excuse me .*?, you lost your wallet" in logs.debug
```

...producing this message in your tests:

```
assert for regex 'Excuse me .*?, you lost your wallet' check in DEBUG, failed; logged lines:
      DEBUG     'Excuse me madam, you dropped your wallet'
```

This one will also fail (different level!)...

```python
    assert "Excuse me .*?, you dropped your wallet" in logs.info
```

...producing this message in your tests:

```
assert for regex 'Excuse me .*?, you dropped your wallet' check in INFO, failed; logged lines:
       DEBUG     'Excuse me madam, you dropped your wallet'
```

A more complex example, with several log lines, and a specific assertion:

```python
    logger.info("Starting system")
    places = ['/tmp/', '~/temp']
    logger.debug("Checking for config XYZ in all these places %s", places)
    logger.warning("bad config XYZ")

    assert "bad config XYZ" in logs.debug
```

See how the test failure message is super helpful:

```
assert for regex 'bad config XYZ' check in DEBUG, failed; logged lines:
       INFO      'Starting system'
       DEBUG     "Checking for config XYZ in all these places ['/tmp/', '~/temp']"
       WARNING   'bad config XYZ'

```

### What about repeated verifications?

Sometimes it's needed to verify that something if logged only once (e.g.
welcoming messages). In this cases it's super useful to use the `reset`
method.

See the following test sequence:

```python
def test_welcoming message(logs):
    logger.info("foo")  # first log! it should trigger the welcoming message
    assert "Welcome" in logs.info

    logs.reset()
    logger.info("foo")  # second log! it should NOT trigger the welcoming message
    assert "Welcome" not in logs.info
```


## For classic TestCases

All you need to do is to call this module's `setup()` passing the test case
instance, and the logger you want to supervise.

Like

```python
class MyTestCase(unittest.TestCase):
    """Example."""

    def setUp(self):
        logassert.setup(self, 'mylogger')
```

In the example, `mylogger` is the name of the logging to supervise. If
different subsystems of your code log in other loggers, this tester
won't notice.

Then, to use it, just call the `assertLogged` method and it's family,
passing all the strings you want to find. This is the default behaviour for
backwards compatibility.

Example:

```python
    def test_blah(self):
        (...)
        self.assertLoggedDebug('secret', 'life', '42')
```

That line will check that "secret", "life" and "42" are all logged in the
same logging call, in DEBUG level.

So, if you logged this, the test will pass:

```python
logger.debug("The secret of life, the universe and everything is %d", 42)
```

Note that the message checked is the one with all parameters replaced.

But if you logged any of the following, the test will fail (the first because
it misses one of the string, the second because it has the wrong log level)::

```python
logger.debug("The secret of life, the universe and everything is lost")
logger.info("The secret of life, the universe and everything is 42")
```

### What can I test?

You'll have at disposition several assertion methods:

- `self.assertLogged`: will check that the strings 
  were logged, no matter at which level

- `self.assertLoggedLEVEL` (being LEVEL one of Error, 
  Warning, Info, or Debug): will check that the strings were logged at 
  that specific level.

- `self.assertNotLogged`: will check that the 
  strings were NOT logged, no matter at which level

- `self.assertNotLoggedLEVEL` (being LEVEL one of 
  Error, Warning, Info, or Debug): will check that the strings were NOT 
  logged at that specific level.



# Nice! But...

If you need help, or have any question, or found any issue, please open a
ticket [here](https://github.com/facundobatista/logassert/issues/new).

Thanks in advance for your time.




%package help
Summary:	Development documents and examples for logassert
Provides:	python3-logassert-doc
%description help
# Log Assertion

![Python package](https://github.com/facundobatista/logassert/workflows/Python%20package/badge.svg)

## What?

A simple log assertion mechanism for Python unittests.


## Why?

As is vox populi, you must also test the logging calls in your programs.

With `logassert` this is now very easy.


# Awesome! How do I use it?

The same functionality is exposed in two very different ways, one that fits better the *pytest semantics*, the other one more suitable for classic unit tests.

## For pytest

All you need to do is to declare `logs` in your test arguments, it works
just like any other fixture.

Then you just check (using `assert`, as usual with *pytest*) if a specific 
line is in the logs for a specific level.

Example:

```python
def test_bleh(logs)
    (...)
    assert "The meaning of life is 42" in logs.debug
```

Actually, the line you write is a regular expression, so you can totally 
do (in case you're not exactly sure which the meaning of life is):

```python
    assert "The meaning of life is \d+" in logs.debug
```

The indicated string is searched to be inside the log lines, it doesn't 
need to be exact whole line. If you want that, just indicate it as with
any regular expression:

```python
    assert "^The meaning of life is \d+$" in logs.debug
```

In a similar way you can also express the desire to check if it's at the 
beginning or at the end of the log lines.

> **NOTE**: the message checked is the final one, after the logging system 
replaced all the indicated parameters in the indicated string.

If you want to verify that a text was logged, no matter at which level,
just do:

```python
    assert "The meaning of life is 42" in logs.any_level
```

To verify that some text was NOT logged, just juse the Python's syntax! 
For example:

```python
    assert "A problem happened" not in logs.error
```

### But I don't like regexes, I want the exact string

Then you just import `Exact` from `logassert` and wrap the string 
with that.

For example, in this case the `..` means exactly two dots, no regex
semantics at all:

```python
    assert Exact("The meaning of life is ..") in logs.any_level
```


### Anyway, I liked old behaviour of searching multiple strings

Then you may want to import `Multiple` from `logassert` and wrap the
different strings you had in each call for the classic behaviour.

For example:

```python
    assert Multiple("life", "meaning", "42") in logs.any_level
```


### What if I want to check that nothing was logged?

The simplest way to do it is to use the `NOTHING` verifier that you can 
import from `logassert`:

```python
    assert NOTHING in logs.debug
```

Note that it doesn't make sense to use it by the negative (`...NOTHING not in logs...`): 
is no really useful at testing level to know that "something was logged", you should
improve the test to specifically verify *what* was logged.


### Breaking the "per line barrier"

Sometimes it's useful to verify that several lines were logged, and that 
those lines are logged one after the other, as they build a "composite 
message".

To achieve that control on the logged lines you can use the `Sequence`
helper, that receives all the lines to verify (regexes by default, but
you can use the other helpers there):

```python
    assert Sequence(
        "Got 2 errors and \d+ warnings:",
        Exact("  error 1: foo"),
        Exact("  error 2: bar"),
    ) in logs.debug
```    


### Examples

After logging...

```python
    person = "madam"
    item = "wallet"
    logger.debug("Excuse me %s, you dropped your %s", person, item)
```

...the following test will just pass:

```python
    assert "Excuse me .*?, you dropped your wallet" in logs.debug
```

However, the following will fail (different text!)...

```python
    assert "Excuse me .*?, you lost your wallet" in logs.debug
```

...producing this message in your tests:

```
assert for regex 'Excuse me .*?, you lost your wallet' check in DEBUG, failed; logged lines:
      DEBUG     'Excuse me madam, you dropped your wallet'
```

This one will also fail (different level!)...

```python
    assert "Excuse me .*?, you dropped your wallet" in logs.info
```

...producing this message in your tests:

```
assert for regex 'Excuse me .*?, you dropped your wallet' check in INFO, failed; logged lines:
       DEBUG     'Excuse me madam, you dropped your wallet'
```

A more complex example, with several log lines, and a specific assertion:

```python
    logger.info("Starting system")
    places = ['/tmp/', '~/temp']
    logger.debug("Checking for config XYZ in all these places %s", places)
    logger.warning("bad config XYZ")

    assert "bad config XYZ" in logs.debug
```

See how the test failure message is super helpful:

```
assert for regex 'bad config XYZ' check in DEBUG, failed; logged lines:
       INFO      'Starting system'
       DEBUG     "Checking for config XYZ in all these places ['/tmp/', '~/temp']"
       WARNING   'bad config XYZ'

```

### What about repeated verifications?

Sometimes it's needed to verify that something if logged only once (e.g.
welcoming messages). In this cases it's super useful to use the `reset`
method.

See the following test sequence:

```python
def test_welcoming message(logs):
    logger.info("foo")  # first log! it should trigger the welcoming message
    assert "Welcome" in logs.info

    logs.reset()
    logger.info("foo")  # second log! it should NOT trigger the welcoming message
    assert "Welcome" not in logs.info
```


## For classic TestCases

All you need to do is to call this module's `setup()` passing the test case
instance, and the logger you want to supervise.

Like

```python
class MyTestCase(unittest.TestCase):
    """Example."""

    def setUp(self):
        logassert.setup(self, 'mylogger')
```

In the example, `mylogger` is the name of the logging to supervise. If
different subsystems of your code log in other loggers, this tester
won't notice.

Then, to use it, just call the `assertLogged` method and it's family,
passing all the strings you want to find. This is the default behaviour for
backwards compatibility.

Example:

```python
    def test_blah(self):
        (...)
        self.assertLoggedDebug('secret', 'life', '42')
```

That line will check that "secret", "life" and "42" are all logged in the
same logging call, in DEBUG level.

So, if you logged this, the test will pass:

```python
logger.debug("The secret of life, the universe and everything is %d", 42)
```

Note that the message checked is the one with all parameters replaced.

But if you logged any of the following, the test will fail (the first because
it misses one of the string, the second because it has the wrong log level)::

```python
logger.debug("The secret of life, the universe and everything is lost")
logger.info("The secret of life, the universe and everything is 42")
```

### What can I test?

You'll have at disposition several assertion methods:

- `self.assertLogged`: will check that the strings 
  were logged, no matter at which level

- `self.assertLoggedLEVEL` (being LEVEL one of Error, 
  Warning, Info, or Debug): will check that the strings were logged at 
  that specific level.

- `self.assertNotLogged`: will check that the 
  strings were NOT logged, no matter at which level

- `self.assertNotLoggedLEVEL` (being LEVEL one of 
  Error, Warning, Info, or Debug): will check that the strings were NOT 
  logged at that specific level.



# Nice! But...

If you need help, or have any question, or found any issue, please open a
ticket [here](https://github.com/facundobatista/logassert/issues/new).

Thanks in advance for your time.




%prep
%autosetup -n logassert-7

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-logassert -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Tue May 30 2023 Python_Bot <Python_Bot@openeuler.org> - 7-1
- Package Spec generated