|
| 1 | +# This file is part of arduino-cli. |
| 2 | +# |
| 3 | +# Copyright 2020 ARDUINO SA (http://www.arduino.cc/) |
| 4 | +# |
| 5 | +# This software is released under the GNU General Public License version 3, |
| 6 | +# which covers the main part of arduino-cli. |
| 7 | +# The terms of this license can be found at: |
| 8 | +# https://www.gnu.org/licenses/gpl-3.0.en.html |
| 9 | +# |
| 10 | +# You can be released from the requirements of the above licenses by purchasing |
| 11 | +# a commercial license. Buying such a license is mandatory if you want to modify or |
| 12 | +# otherwise use the software for commercial activities involving the Arduino |
| 13 | +# software without disclosing the source code of your own applications. To purchase |
| 14 | +# a commercial license, send an email to license@arduino.cc. |
| 15 | +importos |
| 16 | +importplatform |
| 17 | + |
| 18 | + |
| 19 | +deftest_cache_clean(run_command): |
| 20 | +""" |
| 21 | + Clean the cache under arduino caching file directory which is |
| 22 | + "<Arduino configure file path>/staging" |
| 23 | + """ |
| 24 | +result=run_command("cache clean") |
| 25 | +assertresult.ok |
| 26 | + |
| 27 | +# Generate /staging directory |
| 28 | +result=run_command("lib list") |
| 29 | +assertresult.ok |
| 30 | + |
| 31 | +result=run_command("cache clean") |
| 32 | +assertresult.ok |
| 33 | + |
| 34 | +running_platform=platform.system() |
| 35 | +homeDir=os.path.expanduser("~") |
| 36 | +ifrunning_platform=="Linux": |
| 37 | +assertnot (os.path.isdir(homeDir+".arduino15/staging")) |
| 38 | +elifrunning_platform=="Darwin": |
| 39 | +assertnot (os.path.isdir(homeDir+"Library/Arduino15/staging")) |
| 40 | +elifrunning_platform=="Windows": |
| 41 | +assertnot (os.path.isdir(homeDir+"Arduino15/staging")) |