def test_day_before_assets_trading(self):
        # use the day before self.bcolz_daily_bar_days[0]
        day = self.env.previous_trading_day(self.bcolz_daily_bar_days[0])

        bar_data = BarData(self.data_portal, lambda: day, "daily")
        self.check_internal_consistency(bar_data)

        self.assertFalse(bar_data.can_trade(self.ASSET1))
        self.assertFalse(bar_data.can_trade(self.ASSET2))

        self.assertFalse(bar_data.is_stale(self.ASSET1))
        self.assertFalse(bar_data.is_stale(self.ASSET2))

        for field in ALL_FIELDS:
            for asset in self.ASSETS:
                asset_value = bar_data.current(asset, field)

                if field in OHLCP:
                    self.assertTrue(np.isnan(asset_value))
                elif field == "volume":
                    self.assertEqual(0, asset_value)
                elif field == "last_traded":
                    self.assertTrue(asset_value is pd.NaT)
dataset/ETHPy150Open quantopian/zipline/tests/test_bar_data.py/TestDailyBarData.test_day_before_assets_trading/original