TST: Added test to check that the freqstr attribute of the index is p…
…reserved after a shift operation. Run black and flake8.

- [x] closes #21275
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry (omitted, test only)

thanks @KD-dev-lab 